diff --git a/reactos/include/psdk/rpcndr.h b/reactos/include/psdk/rpcndr.h index 15f1cb2a21d..1f7af872b8c 100644 --- a/reactos/include/psdk/rpcndr.h +++ b/reactos/include/psdk/rpcndr.h @@ -111,7 +111,7 @@ typedef unsigned char boolean; #define midl_user_free MIDL_user_free #define midl_user_allocate MIDL_user_allocate -#define NdrFcShort(s) (unsigned char)(s & 0xff), (unsigned char)(s >> 8) +#define NdrFcShort(s) (unsigned char)(s & 0xff), (unsigned char)((s & 0xff00) >> 8) #define NdrFcLong(s) (unsigned char)(s & 0xff), (unsigned char)((s & 0x0000ff00) >> 8), \ (unsigned char)((s & 0x00ff0000) >> 16), (unsigned char)(s >> 24) diff --git a/reactos/include/psdk/winternl.h b/reactos/include/psdk/winternl.h index 7868b035251..b6799f2915c 100644 --- a/reactos/include/psdk/winternl.h +++ b/reactos/include/psdk/winternl.h @@ -1987,7 +1987,7 @@ BOOL WINAPI RtlEqualPrefixSid(PSID,PSID); BOOL WINAPI RtlEqualSid(PSID,PSID); BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN); BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN); -void WINAPI RtlExitUserThread(ULONG) DECLSPEC_NORETURN; +DECLSPEC_NORETURN void WINAPI RtlExitUserThread(ULONG); NTSTATUS WINAPI RtlExpandEnvironmentStrings_U(PWSTR, const UNICODE_STRING*, UNICODE_STRING*, ULONG*); LONGLONG WINAPI RtlExtendedMagicDivide(LONGLONG,LONGLONG,INT); LONGLONG WINAPI RtlExtendedIntegerMultiply(LONGLONG,INT); diff --git a/reactos/include/reactos/wine/port.h b/reactos/include/reactos/wine/port.h index 56602d8ba49..fb67f53a0bd 100644 --- a/reactos/include/reactos/wine/port.h +++ b/reactos/include/reactos/wine/port.h @@ -326,7 +326,7 @@ extern int spawnvp(int mode, const char *cmdname, const char * const argv[]); /* Interlocked functions */ -#if defined(__i386__) && defined(__GNUC__) && !defined(WINE_PORT_NO_INTERLOCKED) +#if defined(_MSC_VER) || (defined(__i386__) && defined(__GNUC__) && !defined(WINE_PORT_NO_INTERLOCKED)) #define interlocked_cmpxchg InterlockedCompareExchange #define interlocked_cmpxchg_ptr InterlockedCompareExchangePtr diff --git a/reactos/lib/3rdparty/adns/adns_win32/adns_unix_calls.c b/reactos/lib/3rdparty/adns/adns_win32/adns_unix_calls.c index 93013b3c8bd..973d78b4a92 100644 --- a/reactos/lib/3rdparty/adns/adns_win32/adns_unix_calls.c +++ b/reactos/lib/3rdparty/adns/adns_win32/adns_unix_calls.c @@ -39,7 +39,7 @@ int adns_writev(int FileDescriptor, const struct iovec * iov, int iovCount) for(; i < iovCount; i++) total_len += iov[i].iov_len; - p = buf = (char *)alloca(total_len); + p = buf = (char *)_alloca(total_len); for(; i < iovCount; i++) { @@ -79,28 +79,28 @@ int adns_getpid() int gettimeofday(struct timeval *tv, struct timezone *tz) { - static __int64 Adjustment; + static __int64 Adjustment; __int64 now = 0; - - if (!Adjustment) - { + + if (!Adjustment) + { SYSTEMTIME st = {1970,1,0,1,0,0,0}; SystemTimeToFileTime(&st, (LPFILETIME)&Adjustment); - } - - if (tz) - { + } + + if (tz) + { errno = EINVAL; - return -1; - } - + return -1; + } + GetSystemTimeAsFileTime((LPFILETIME)&now); now -= Adjustment; - + tv->tv_sec = (long)(now / 10000000); tv->tv_usec = (long)((now % 10000000) / 10); - return 0; + return 0; } /* Memory allocated in the DLL must be freed in the dll, so diff --git a/reactos/lib/3rdparty/adns/src/setup.c b/reactos/lib/3rdparty/adns/src/setup.c index c0c6c4f514d..f62b4d49203 100644 --- a/reactos/lib/3rdparty/adns/src/setup.c +++ b/reactos/lib/3rdparty/adns/src/setup.c @@ -573,7 +573,7 @@ int adns_init(adns_state *ads_r, adns_initflags flags, FILE *diagfile) { char PathBuf[MAX_PATH]; struct in_addr addr; #define ADNS_PFIXED_INFO_BLEN (2048) - PFIXED_INFO network_info = (PFIXED_INFO)alloca(ADNS_PFIXED_INFO_BLEN); + PFIXED_INFO network_info = (PFIXED_INFO)_alloca(ADNS_PFIXED_INFO_BLEN); ULONG network_info_blen = ADNS_PFIXED_INFO_BLEN; DWORD network_info_result; PIP_ADDR_STRING pip; diff --git a/reactos/lib/3rdparty/libwine/debug.c b/reactos/lib/3rdparty/libwine/debug.c index acf4d8289cf..472525d9e0f 100644 --- a/reactos/lib/3rdparty/libwine/debug.c +++ b/reactos/lib/3rdparty/libwine/debug.c @@ -188,7 +188,7 @@ static void debug_init(void) char *wine_debug; DWORD dwLength; /* GetEnvironmentVariableA will change LastError! */ - DWORD LastError = GetLastError(); + DWORD LastError = GetLastError(); if (nb_debug_options != -1) return; /* already initialized */ nb_debug_options = 0; @@ -278,7 +278,7 @@ static void release_temp_buffer( char *buffer, size_t size ) /* default implementation of wine_dbgstr_an */ static const char *default_dbgstr_an( const char *str, int n ) { - static const char hex[16] = "0123456789abcdef"; + static const char hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; char *dst, *res; size_t size; diff --git a/reactos/lib/3rdparty/libwine/debug_ros.c b/reactos/lib/3rdparty/libwine/debug_ros.c index 5175ddda6cc..fd1e6775257 100644 --- a/reactos/lib/3rdparty/libwine/debug_ros.c +++ b/reactos/lib/3rdparty/libwine/debug_ros.c @@ -8,6 +8,7 @@ #include "debug.c" +__MINGW_ATTRIB_MALLOC void *malloc(size_t size) { return LocalAlloc(0, size); @@ -24,6 +25,7 @@ void *realloc(void *ptr, size_t size) return LocalReAlloc(ptr, size, LMEM_MOVEABLE); } +__MINGW_ATTRIB_MALLOC char *_strdup(const char *str) { char *newstr = malloc(strlen(str) + 1); diff --git a/reactos/lib/3rdparty/libwine/string.c b/reactos/lib/3rdparty/libwine/string.c index 09a1de45432..43ee94f558e 100644 --- a/reactos/lib/3rdparty/libwine/string.c +++ b/reactos/lib/3rdparty/libwine/string.c @@ -4,11 +4,11 @@ #ifndef HAVE_STRCASECMP -#ifdef strcasecmp -# undef strcasecmp +#ifdef _stricmp +# undef _stricmp #endif -int strcasecmp( const char *str1, const char *str2 ) +int _stricmp( const char *str1, const char *str2 ) { const unsigned char *ustr1 = (const unsigned char *)str1; const unsigned char *ustr2 = (const unsigned char *)str2; diff --git a/reactos/lib/3rdparty/mingw/wcrt1.c b/reactos/lib/3rdparty/mingw/wcrt1.c index df1cec8e3b2..59385ffb00c 100644 --- a/reactos/lib/3rdparty/mingw/wcrt1.c +++ b/reactos/lib/3rdparty/mingw/wcrt1.c @@ -42,7 +42,7 @@ extern int wmain (int, wchar_t **, wchar_t **); #define __UNKNOWN_APP 0 #define __CONSOLE_APP 1 #define __GUI_APP 2 -__MINGW_IMPORT void __set_app_type(int); +_CRTIMP void __set_app_type(int); #endif /* __MSVCRT__ */ /* Global _fmode for this .exe, not the one in msvcrt.dll, @@ -181,7 +181,7 @@ _gnu_exception_handler (EXCEPTION_POINTERS * exception_data) /* * The function mainCRTStartup is the entry point for all console programs. */ -static void __attribute__((noreturn)) +static void __declspec(noreturn) __mingw_wCRTStartup (void) { int nRet; @@ -218,6 +218,7 @@ __mingw_wCRTStartup (void) _pei386_runtime_relocator (); #endif +#if defined(__GNUC__) #if defined(__i386__) /* Align the stack to 16 bytes for the sake of SSE ops in main or in functions inlined into main. */ @@ -230,6 +231,17 @@ __mingw_wCRTStartup (void) asm __volatile__ ("li 0,15\n\tandc 1,1,0" : : : "r1"); #else #error Unsupported architecture +#endif +#endif + +#if defined(_MSC_VER) +#if defined(_M_IX86) + /* Align the stack to 16 bytes for the sake of SSE ops in main + or in functions inlined into main. */ + __asm and esp, 0FFFFFFF0h +#else +#error Unsupported architecture +#endif #endif /*