- svchost: #ifdef _MSC_VER doesn't mean "using Microsoft's headers" anymore

- ddraw, imm32, msxml3, oleaut32, riched20: Include typeof.h for typeof emulation when compiling under MSVC and remove from ReactOS-generic.rbuild (this can't go to port.h as the modules do not include it).
- TCPIP: Fix a check for MSVC.
- NDIS: Don't use floating point arithmetics in kernel mode -- spotted by MSVC trying to link to ftol (gcc inlined the operation).
- SAMLIB: Use __VA_ARGS__ instead of gcc-specific macro manipulation.
- WIN32CSR: Don't use gcc-specific \% if you want % in the string -- this is incorrect and will pass a broken string to swprintf (the code seems to be uncalled though, so this shouldn't change anything). Use %% instead.
- Error out on MSVC implementation of logb -- it doesn't produce the same code as the gcc version.
- Rename gcc's float.h to gcc_float.h and use #include instead of #include_next for consistency.
- Remove leftover header guard from types.h
- Remove superfluous brackets from PSEH2->MSVC defines -- this isn't necessary anymore after 41597
- Correction to 42216: MSVC *does* let you define types in a function, but only at the top of scope. Move back the C_ASSERT into KiAcquireGuardedMutex.
- Simplify definition of alloca
- scripts.cpp: Silence unavoidable warning.
- Remove compile time warning from Uniata -- the code has been unused for 1 1/2 years and will probably remain so.

svn path=/trunk/; revision=42829
This commit is contained in:
Stefan Ginsberg 2009-08-21 15:57:26 +00:00
parent fb91ab63f5
commit 43b07d3f6a
20 changed files with 44 additions and 32 deletions

View file

@ -100,7 +100,6 @@
<compilerflag>/Zl</compilerflag>
<compilerflag>/Zi</compilerflag>
<compilerflag>/W1</compilerflag>
<compilerflag>/FIwine/typeof.h</compilerflag>
</group>
<group compilerset="gcc">

View file

@ -10,7 +10,7 @@
/* INCLUDES ******************************************************************/
#ifdef _MSC_VER
#if 0
#define _CRT_SECURE_NO_DEPRECATE 1
#endif

View file

@ -7,6 +7,7 @@
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<define name="USE_WIN32_OPENGL" />
<compilerflag compilerset="msc">/FIwine/typeof.h</compilerflag>
<library>advapi32</library>
<library>dxguid</library>

View file

@ -7,6 +7,7 @@
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<redefine name="_WIN32_WINNT">0x600</redefine>
<compilerflag compilerset="msc">/FIwine/typeof.h</compilerflag>
<file>imm.c</file>
<file>version.rc</file>
<library>wine</library>

View file

@ -10,6 +10,7 @@
<define name="_WINE" />
<redefine name="_WIN32_WINNT">0x601</redefine>
<define name="LIBXML_STATIC" />
<compilerflag compilerset="msc">/FIwine/typeof.h</compilerflag>
<library>libxml2</library>
<library>libxslt</library>
<library>wine</library>

View file

@ -15,6 +15,7 @@
<define name="PROXY_DELEGATION"/>
<define name="REGISTER_PROXY_DLL"/>
<define name="ENTRY_PREFIX">OLEAUTPS_</define>
<compilerflag compilerset="msc">/FIwine/typeof.h</compilerflag>
<file>connpt.c</file>
<file>dispatch.c</file>
<file>hash.c</file>

View file

@ -6,6 +6,7 @@
<include base="riched20">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__WINESRC__" />
<compilerflag compilerset="msc">/FIwine/typeof.h</compilerflag>
<linkerflag linkerset="ld">-enable-stdcall-fixup</linkerflag>
<file>caret.c</file>
<file>clipboard.c</file>

View file

@ -1,12 +1,12 @@
#ifdef NDEBUG
#define DPRINT(args...)
#define DPRINT(...)
#define CHECKPOINT
#else
#define DPRINT(args...) do { DebugPrint("(SAMLIB:%s:%d) ",__FILE__,__LINE__); DebugPrint(args); } while(0)
#define DPRINT(...) do { DebugPrint("(SAMLIB:%s:%d) ",__FILE__,__LINE__); DebugPrint(__VA_ARGS__); } while(0)
#define CHECKPOINT do { DebugPrint("(SAMLIB:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0)
#endif
#define DPRINT1(args...) do { DebugPrint("(SAMLIB:%s:%d) ",__FILE__,__LINE__); DebugPrint(args); } while(0)
#define DPRINT1(...) do { DebugPrint("(SAMLIB:%s:%d) ",__FILE__,__LINE__); DebugPrint(__VA_ARGS__); } while(0)
#define CHECKPOINT1 do { DebugPrint("(SAMLIB:%s:%d) Checkpoint\n",__FILE__,__LINE__); } while(0)

View file

@ -705,7 +705,14 @@ NdisReadNetworkAddress(
while (j < str.Length && str.Buffer[j] != '\0') j++;
*NetworkAddressLength = (UINT)((j/2)+0.5);
if ((j % 2) == 0)
{
*NetworkAddressLength = (UINT)(j/2);
}
else
{
*NetworkAddressLength = (UINT)((j/2)+1);
}
if ((*NetworkAddressLength) == 0)
{

View file

@ -1058,7 +1058,7 @@ NTSTATUS DispTdiSendDatagram(
("About to call send routine %x\n",
(*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send)));
if( (*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send) )
if( (*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send != NULL) )
Status = (*((PADDRESS_FILE)Request.Handle.AddressHandle)->Send)(
Request.Handle.AddressHandle,
DgramInfo->SendDatagramInformation,

View file

@ -426,9 +426,8 @@ UniataAhciSetupFIS(
i++;
} else {
#ifdef _MSC_VER
#pragma message ("HACK HACK HACK Disabling warning HACK HACK HACK")
#pragma warning(push)
#pragma warning(disable:4333)
#pragma warning(disable:4333) // right shift by too large amount, data loss
#endif
fis[7] |= (plba[3] >> 24) & 0x0f;
#ifdef _MSC_VER

View file

@ -16,12 +16,12 @@
*
*/
#ifdef __GNUC__
#include_next<float.h>
#endif
#ifdef _MSC_VER
#if defined(__GNUC__)
#include <gcc_float.h>
#elif defined(_MSC_VER)
#include <msc_float.h>
#else
#error
#endif
#ifndef _MINGW_FLOAT_H_

View file

@ -146,13 +146,8 @@ extern "C" {
#endif /* RC_INVOKED */
#ifndef NO_OLDNAMES
#undef alloca
#ifdef __GNUC__
#define alloca(x) __builtin_alloca((x))
#else
#define alloca _alloca
#endif
#endif
#ifdef HEAPHOOK
#ifndef _HEAPHOOK_DEFINED

View file

@ -36,9 +36,7 @@ typedef unsigned int dev_t;
# endif
#endif
#ifdef _WINE
#ifndef _PID_T_
#define _PID_T_
#if defined(_WINE)
#ifndef _WIN64
typedef int _pid_t;
#else
@ -50,7 +48,6 @@ typedef __int64 _pid_t;
typedef _pid_t pid_t;
#endif /* __pid_t_defined */
#endif
#endif /* Not _PID_T_ */
#endif
#endif /* !_INC_TYPES */

View file

@ -370,10 +370,10 @@ __SEH_END_SCOPE_CHAIN;
#include <excpt.h>
#define _SEH2_TRY __try {
#define _SEH2_FINALLY } __finally {
#define _SEH2_EXCEPT(...) } __except(__VA_ARGS__) {
#define _SEH2_END }
#define _SEH2_TRY __try
#define _SEH2_FINALLY __finally
#define _SEH2_EXCEPT(...) __except(__VA_ARGS__)
#define _SEH2_END
#define _SEH2_GetExceptionInformation() (GetExceptionInformation())
#define _SEH2_GetExceptionCode() (GetExceptionCode())

View file

@ -45,6 +45,11 @@
#include "scripts.h"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4351) // elements of array 'array' will be default initialized
#endif
struct SCRIPTS_ScriptsSet
{
private:
@ -145,6 +150,10 @@ public:
}
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
int
WINAPI
GetStringScripts

View file

@ -29,6 +29,7 @@ double _logb (double __x)
("fxtract\n\t"
: "=t" (__junk), "=u" (__val) : "0" (__x));
#else
#error REVIEW ME
__asm fld [__x];
__asm fxtract;
__asm fstp st(0);

View file

@ -117,15 +117,15 @@ KiAcquireFastMutex(IN PFAST_MUTEX FastMutex)
NULL);
}
/* KiAcquireGuardedMutex depends on these bits being right */
C_ASSERT((GM_LOCK_WAITER_WOKEN * 2) == GM_LOCK_WAITER_INC);
VOID
FASTCALL
KiAcquireGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex)
{
ULONG BitsToRemove, BitsToAdd;
LONG OldValue, NewValue;
/* We depend on these bits being just right */
C_ASSERT((GM_LOCK_WAITER_WOKEN * 2) == GM_LOCK_WAITER_INC);
/* Increase the contention count */
GuardedMutex->Contention++;

View file

@ -375,11 +375,11 @@ GuiConsoleOpenUserSettings(PGUI_CONSOLE_DATA GuiData, DWORD ProcessId, PHKEY hSu
while((ptr = wcschr(szProcessName, L'\\')))
ptr[0] = L'_';
swprintf(szBuffer, L"Console\\\%SystemRoot\%%S", &szProcessName[wLength]);
swprintf(szBuffer, L"Console\\%%SystemRoot%%%S", &szProcessName[wLength]);
DPRINT("#3 Path : %S\n", szBuffer);
if (RegOpenKeyExW(hKey, szBuffer, 0, samDesired, hSubKey) == ERROR_SUCCESS)
{
swprintf(GuiData->szProcessName, L"\%SystemRoot\%%S", &szProcessName[wLength]);
swprintf(GuiData->szProcessName, L"%%SystemRoot%%%S", &szProcessName[wLength]);
RegCloseKey(hKey);
return TRUE;
}