mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-31 12:23:31 +00:00
Merging fixes from Visual C++ branch
modified include/psdk/rpcndr.h Mask argument before casting in NdrFcShort modified include/psdk/winternl.h Visual C++-compatible placement of function attribute modified include/reactos/wine/port.h Visual C++ has interlocked intrinsics, too modified lib/3rdparty/adns/adns_win32/adns_unix_calls.c modified lib/3rdparty/adns/src/setup.c alloca -> _alloca modified lib/3rdparty/libwine/debug.c Fix a benign range check warning modified lib/3rdparty/libwine/debug_ros.c Properly decorate malloc replacement modified lib/3rdparty/libwine/string.c The actual function is called _stricmp modified lib/3rdparty/mingw/wcrt1.c Visual C++ support svn path=/trunk/; revision=37659
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
+14
-14
@@ -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
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
Vendored
+2
-2
@@ -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;
|
||||
|
||||
|
||||
+2
@@ -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);
|
||||
|
||||
+3
-3
@@ -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;
|
||||
|
||||
Vendored
+14
-2
@@ -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
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user