Hey Arch, next time you change 3rdparty code, either make sure, it's merged upstream or provide a diff, please.

Adding back MSVC fixes.

svn path=/branches/ros-amd64-bringup/; revision=43964
This commit is contained in:
Timo Kreuzer
2009-11-04 23:15:07 +00:00
parent 0252732c7f
commit 1dac06d95f
9 changed files with 228 additions and 2 deletions
@@ -32,6 +32,12 @@ extern "C" {
#define __IOINFO_TM_UTF8 1
#define __IOINFO_TM_UTF16LE 2
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4214)
#pragma warning(disable:4820)
#endif
typedef struct {
intptr_t osfhnd;
char osfile;
@@ -43,6 +49,10 @@ extern "C" {
char pipech2[2];
} ioinfo;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#define IOINFO_ARRAY_ELTS (1 << 5)
#define _pioinfo(i) (__pioinfo[(i) >> 5] + ((i) & (IOINFO_ARRAY_ELTS - 1)))
@@ -30,6 +30,11 @@
#endif
#endif
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4214)
#endif
typedef struct _FTIME
{
unsigned short twosecs : 5;
@@ -46,6 +51,10 @@ typedef struct _FDATE
unsigned short year : 7;
} FDATE;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
typedef FDATE *PFDATE;
#endif
@@ -0,0 +1,83 @@
Index: internal.h
===================================================================
--- internal.h (Revision 43956)
+++ internal.h (Arbeitskopie)
@@ -32,6 +32,12 @@
#define __IOINFO_TM_UTF8 1
#define __IOINFO_TM_UTF16LE 2
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4214)
+#pragma warning(disable:4820)
+#endif
+
typedef struct {
intptr_t osfhnd;
char osfile;
@@ -43,6 +49,10 @@
char pipech2[2];
} ioinfo;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
#define IOINFO_ARRAY_ELTS (1 << 5)
#define _pioinfo(i) (__pioinfo[(i) >> 5] + ((i) & (IOINFO_ARRAY_ELTS - 1)))
Index: oscalls.h
===================================================================
--- oscalls.h (Revision 43956)
+++ oscalls.h (Arbeitskopie)
@@ -30,6 +30,11 @@
#endif
#endif
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4214)
+#endif
+
typedef struct _FTIME
{
unsigned short twosecs : 5;
@@ -46,6 +51,10 @@
unsigned short year : 7;
} FDATE;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
typedef FDATE *PFDATE;
#endif
Index: sect_attribs.h
===================================================================
--- sect_attribs.h (Revision 43956)
+++ sect_attribs.h (Arbeitskopie)
@@ -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
@@ -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
+11 -1
View File
@@ -7,6 +7,16 @@
void _fpreset (void);
void _fpreset (void)
{ __asm__ ("fninit" ) ;}
{
#ifdef __GNUC__
__asm__ ("fninit" );
#else
__asm fninit;
#endif
}
#ifdef __GNUC__
void __attribute__ ((alias ("_fpreset"))) fpreset(void);
#else
void fpreset(void) { _fpreset(); }
#endif
+4
View File
@@ -14,4 +14,8 @@ void _fpreset (void)
(* __MINGW_IMP_SYMBOL(_fpreset))();
}
#ifdef __GNUC__
void __attribute__ ((alias ("_fpreset"))) fpreset(void);
#else
void fpreset(void) { _fpreset(); }
#endif
+5
View File
@@ -20,6 +20,7 @@
#include <tchar.h>
#include <sect_attribs.h>
#include <locale.h>
#include <intrin.h>
#ifndef __winitenv
extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
@@ -51,7 +52,11 @@ extern int * __MINGW_IMP_SYMBOL(_commode);
#define _commode (* __MINGW_IMP_SYMBOL(_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 *);
+10
View File
@@ -112,12 +112,22 @@ __report_gsfailure (ULONGLONG StackCookie)
else
#endif
{
#ifdef __GNUC__
#ifdef _WIN64
GS_ContextRecord.Rip = (ULONGLONG) __builtin_return_address (0);
GS_ContextRecord.Rsp = (ULONGLONG) __builtin_frame_address (0) + 8;
#else
GS_ContextRecord.Eip = (DWORD) __builtin_return_address (0);
GS_ContextRecord.Esp = (DWORD) __builtin_frame_address (0) + 4;
#endif
#else
#ifdef _WIN64
GS_ContextRecord.Rip = (ULONGLONG) _ReturnAddress();
GS_ContextRecord.Rsp = (ULONGLONG) _AddressOfReturnAddress();
#else
GS_ContextRecord.Eip = (DWORD) _ReturnAddress();
GS_ContextRecord.Esp = (DWORD) _AddressOfReturnAddress();
#endif
#endif
}
+87
View File
@@ -0,0 +1,87 @@
Index: CRT_fp10.c
===================================================================
--- CRT_fp10.c (Revision 43956)
+++ CRT_fp10.c (Arbeitskopie)
@@ -7,6 +7,16 @@
void _fpreset (void);
void _fpreset (void)
- { __asm__ ("fninit" ) ;}
+{
+#ifdef __GNUC__
+ __asm__ ("fninit" );
+#else
+ __asm fninit;
+#endif
+}
+#ifdef __GNUC__
void __attribute__ ((alias ("_fpreset"))) fpreset(void);
+#else
+void fpreset(void) { _fpreset(); }
+#endif
Index: CRT_fp8.c
===================================================================
--- CRT_fp8.c (Revision 43956)
+++ CRT_fp8.c (Arbeitskopie)
@@ -14,4 +14,8 @@
(* __MINGW_IMP_SYMBOL(_fpreset))();
}
+#ifdef __GNUC__
void __attribute__ ((alias ("_fpreset"))) fpreset(void);
+#else
+void fpreset(void) { _fpreset(); }
+#endif
Index: crtexe.c
===================================================================
--- crtexe.c (Revision 43956)
+++ crtexe.c (Arbeitskopie)
@@ -20,6 +20,7 @@
#include <tchar.h>
#include <sect_attribs.h>
#include <locale.h>
+#include <intrin.h>
#ifndef __winitenv
extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
@@ -51,7 +52,11 @@
#define _commode (* __MINGW_IMP_SYMBOL(_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 *);
Index: gs_support.c
===================================================================
--- gs_support.c (Revision 43956)
+++ gs_support.c (Arbeitskopie)
@@ -112,6 +112,7 @@
else
#endif
{
+#ifdef __GNUC__
#ifdef _WIN64
GS_ContextRecord.Rip = (ULONGLONG) __builtin_return_address (0);
GS_ContextRecord.Rsp = (ULONGLONG) __builtin_frame_address (0) + 8;
@@ -119,6 +120,15 @@
GS_ContextRecord.Eip = (DWORD) __builtin_return_address (0);
GS_ContextRecord.Esp = (DWORD) __builtin_frame_address (0) + 4;
#endif
+#else
+#ifdef _WIN64
+ GS_ContextRecord.Rip = (ULONGLONG) _ReturnAddress();
+ GS_ContextRecord.Rsp = (ULONGLONG) _AddressOfReturnAddress();
+#else
+ GS_ContextRecord.Eip = (DWORD) _ReturnAddress();
+ GS_ContextRecord.Esp = (DWORD) _AddressOfReturnAddress();
+#endif
+#endif
}
#ifdef _WIN64