Author: sginsberg Date: Fri Sep 18 17:22:28 2009 New Revision: 43073
URL: http://svn.reactos.org/svn/reactos?rev=43073&view=rev Log: - _mingw.h: Don't define __attribute__ to nothing -- this is only good for creating bugs. - sect_attribs.h: Define _CRTALLOC for msvc. Enable #pragma section and add missing .tls and .tls$ZZZ. - mingw runtime: Only use __attribute__((weak)) for gcc. - freeldr: Use #pragma pack instead of __attribute__((packed)). - kernel32: Only alias __cxa_pure_virtual to _purecall for gcc.
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c trunk/reactos/dll/win32/kernel32/misc/icustubs.cpp trunk/reactos/include/crt/_mingw.h trunk/reactos/include/reactos/mingw-w64/sect_attribs.h trunk/reactos/lib/3rdparty/mingw/crtexe.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c [iso-8859-1] Fri Sep 18 17:22:28 2009 @@ -23,6 +23,8 @@ #define NDEBUG #include <debug.h>
+#include <pshpack1.h> + typedef struct _ROUTING_SLOT { UCHAR BusNumber; @@ -37,7 +39,7 @@ USHORT BitmapD; UCHAR SlotNumber; UCHAR Reserved; -} __attribute__((packed)) ROUTING_SLOT, *PROUTING_SLOT; +} ROUTING_SLOT, *PROUTING_SLOT;
typedef struct _PCI_IRQ_ROUTING_TABLE { @@ -52,7 +54,9 @@ UCHAR Reserved[11]; UCHAR Checksum; ROUTING_SLOT Slot[1]; -} __attribute__((packed)) PCI_IRQ_ROUTING_TABLE, *PPCI_IRQ_ROUTING_TABLE; +} PCI_IRQ_ROUTING_TABLE, *PPCI_IRQ_ROUTING_TABLE; + +#include <poppack.h>
typedef struct _PCI_REGISTRY_INFO {
Modified: trunk/reactos/dll/win32/kernel32/misc/icustubs.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/icu... ============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/icustubs.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/icustubs.cpp [iso-8859-1] Fri Sep 18 17:22:28 2009 @@ -65,7 +65,9 @@ return 0; }
+#if defined(__GNUC__) __attribute__((alias("_purecall"))) void __cxa_pure_virtual(void); +#endif
void _assert() {
Modified: trunk/reactos/include/crt/_mingw.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/_mingw.h?rev=43... ============================================================================== --- trunk/reactos/include/crt/_mingw.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/_mingw.h [iso-8859-1] Fri Sep 18 17:22:28 2009 @@ -29,8 +29,6 @@ # if !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__CYGWIN32__) # define __declspec(x) __attribute__((x)) # endif -#else -# define __attribute__(x) /* nothing */ #endif
#ifdef _MSC_VER
Modified: trunk/reactos/include/reactos/mingw-w64/sect_attribs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/mingw-w64/s... ============================================================================== --- trunk/reactos/include/reactos/mingw-w64/sect_attribs.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/mingw-w64/sect_attribs.h [iso-8859-1] Fri Sep 18 17:22:28 2009 @@ -10,7 +10,7 @@ #define _ATTRIBUTES shared #endif
-#if 0 +#if defined(_MSC_VER) /* Reference list of existing section for msvcrt. */ #pragma section(".CRTMP$XCA",long,_ATTRIBUTES) #pragma section(".CRTMP$XCZ",long,_ATTRIBUTES) @@ -55,6 +55,14 @@ #pragma section(".rtc$IZZ",long,read) #pragma section(".rtc$TAA",long,read) #pragma section(".rtc$TZZ",long,read) +#pragma section(".tls",long,read,write) +#pragma section(".tls$ZZZ",long,read,write) #endif
+#if defined(_MSC_VER) +#define _CRTALLOC(x) __declspec(allocate(x)) +#elif defined(__GNUC__) #define _CRTALLOC(x) __attribute__ ((section (x) )) +#else +#error +#endif
Modified: trunk/reactos/lib/3rdparty/mingw/crtexe.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/mingw/crtexe.c... ============================================================================== --- trunk/reactos/lib/3rdparty/mingw/crtexe.c [iso-8859-1] (original) +++ trunk/reactos/lib/3rdparty/mingw/crtexe.c [iso-8859-1] Fri Sep 18 17:22:28 2009 @@ -52,7 +52,11 @@ #define _commode (*_imp___commode) extern int _dowildcard;
+#if defined(__GNUC__) int _MINGW_INSTALL_DEBUG_MATHERR __attribute__((weak)) = 0; +#else +int _MINGW_INSTALL_DEBUG_MATHERR = 0; +#endif extern int __defaultmatherr; extern _CRTIMP void __cdecl _initterm(_PVFV *, _PVFV *);