- winddk.h: Don't define NTSYSAPI and NTSYSCALLAPI -- this is defined in ntdef.h. Use NTSYSAPI for HalDispatchTable instead of DECLSPEC_IMPORT (see below).

- wdm.h: Properly define NTKERNELAPI.
- ntifs.h: Properly define NTKERNELAPI, and don't redefine NTSYSAPI.
- ntoskrnl: Apply the WDK hack for our headers (and gcc) too. Also redefine NTHALAPI for NDK so we don't auto-import KdComPortInUse -- ld complains about this.
- Apply this for cmlib, csq and rossym too.
- Use this in HAL too, and redefine NTSYSAPI so we don't auto import some structures from the kernel. Also, don't define __declspec(dllimport) to nothing -- this doesn't work with gcc, and doesn't seem to be necessary. I tried building HAL with the WDK and this wasn't an issue.

svn path=/trunk/; revision=42461
This commit is contained in:
Stefan Ginsberg 2009-08-07 10:45:59 +00:00
parent 8a3b6b1983
commit ac7daf7ccf
10 changed files with 15 additions and 42 deletions

View file

@ -12,14 +12,13 @@
#include <stdio.h> #include <stdio.h>
/* WDK HAL Compilation hack */ /* WDK HAL Compilation hack */
#ifdef _MSC_VER
#include <excpt.h> #include <excpt.h>
#include <ntdef.h> #include <ntdef.h>
#undef _NTHAL_ #undef _NTHAL_
#undef DECLSPEC_IMPORT #undef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT #define DECLSPEC_IMPORT
#define __declspec(dllimport) #undef NTSYSAPI
#endif #define NTSYSAPI __declspec(dllimport)
/* IFS/DDK/NDK Headers */ /* IFS/DDK/NDK Headers */
#include <ntifs.h> #include <ntifs.h>

View file

@ -12,14 +12,13 @@
#include <stdio.h> #include <stdio.h>
/* WDK HAL Compilation hack */ /* WDK HAL Compilation hack */
#ifdef _MSC_VER
#include <excpt.h> #include <excpt.h>
#include <ntdef.h> #include <ntdef.h>
#undef _NTHAL_ #undef _NTHAL_
#undef DECLSPEC_IMPORT #undef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT #define DECLSPEC_IMPORT
#define __declspec(dllimport) #undef NTSYSAPI
#endif #define NTSYSAPI __declspec(dllimport)
/* IFS/DDK/NDK Headers */ /* IFS/DDK/NDK Headers */
#include <ntifs.h> #include <ntifs.h>

View file

@ -12,14 +12,13 @@
#include <stdio.h> #include <stdio.h>
/* WDK HAL Compilation hack */ /* WDK HAL Compilation hack */
#ifdef _MSC_VER
#include <excpt.h> #include <excpt.h>
#include <ntdef.h> #include <ntdef.h>
#undef _NTHAL_ #undef _NTHAL_
#undef DECLSPEC_IMPORT #undef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT #define DECLSPEC_IMPORT
#define __declspec(dllimport) #undef NTSYSAPI
#endif #define NTSYSAPI __declspec(dllimport)
/* IFS/DDK/NDK Headers */ /* IFS/DDK/NDK Headers */
#include <ntifs.h> #include <ntifs.h>

View file

@ -24,12 +24,7 @@
#define _NTIFS_ #define _NTIFS_
#define _GNU_NTIFS_ #define _GNU_NTIFS_
#ifdef _NTOSKRNL_
/* HACKHACKHACK!!! We shouldn't include this header from ntoskrnl! */
#define NTKERNELAPI
#else
#define NTKERNELAPI DECLSPEC_IMPORT #define NTKERNELAPI DECLSPEC_IMPORT
#endif
#include <ntddk.h> #include <ntddk.h>
@ -44,10 +39,6 @@ extern "C" {
#define VER_PRODUCTBUILD 10000 #define VER_PRODUCTBUILD 10000
#endif #endif
#ifndef NTSYSAPI
#define NTSYSAPI
#endif
#define EX_PUSH_LOCK ULONG_PTR #define EX_PUSH_LOCK ULONG_PTR
#define PEX_PUSH_LOCK PULONG_PTR #define PEX_PUSH_LOCK PULONG_PTR

View file

@ -21,12 +21,7 @@
extern "C" { extern "C" {
#endif #endif
#ifdef _NTOSKRNL_
/* HACKHACKHACK!!! We shouldn't include this header from ntoskrnl! */
#define NTKERNELAPI
#else
#define NTKERNELAPI DECLSPEC_IMPORT #define NTKERNELAPI DECLSPEC_IMPORT
#endif
#ifdef _WIN64 #ifdef _WIN64
#define PORT_MAXIMUM_MESSAGE_LENGTH 512 #define PORT_MAXIMUM_MESSAGE_LENGTH 512

View file

@ -67,18 +67,6 @@ extern "C" {
# define _DDK_DUMMYUNION_N_MEMBER(n, name) name # define _DDK_DUMMYUNION_N_MEMBER(n, name) name
#endif #endif
#if !defined(_NTSYSTEM_)
#define NTSYSAPI DECLSPEC_IMPORT
#define NTSYSCALLAPI DECLSPEC_IMPORT
#else
#define NTSYSAPI
#if defined(_NTDLLBUILD_)
#define NTSYSCALLAPI
#else
#define NTSYSCALLAPI DECLSPEC_ADDRSAFE
#endif
#endif
/* /*
* Alignment Macros * Alignment Macros
*/ */
@ -2866,7 +2854,7 @@ typedef struct {
} HAL_DISPATCH, *PHAL_DISPATCH; } HAL_DISPATCH, *PHAL_DISPATCH;
#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTHAL_) #if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTHAL_)
extern DECLSPEC_IMPORT PHAL_DISPATCH HalDispatchTable; extern NTSYSAPI PHAL_DISPATCH HalDispatchTable;
#define HALDISPATCH ((PHAL_DISPATCH)&HalDispatchTable) #define HALDISPATCH ((PHAL_DISPATCH)&HalDispatchTable)
#else #else
extern DECLSPEC_EXPORT HAL_DISPATCH HalDispatchTable; extern DECLSPEC_EXPORT HAL_DISPATCH HalDispatchTable;

View file

@ -88,7 +88,9 @@
#define CMLTRACE(x, ...) DPRINT(__VA_ARGS__) #define CMLTRACE(x, ...) DPRINT(__VA_ARGS__)
#endif #endif
#include <ntdef.h>
#undef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT
#include <ntddk.h> #include <ntddk.h>
#endif #endif

View file

@ -25,11 +25,9 @@
*/ */
/* $Id$ */ /* $Id$ */
#ifdef _MSC_VER
#include <ntdef.h> #include <ntdef.h>
#undef DECLSPEC_IMPORT #undef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT #define DECLSPEC_IMPORT
#endif
#include <ntifs.h> #include <ntifs.h>

View file

@ -7,7 +7,9 @@
* PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com)
*/ */
#define _NTOSKRNL_ #include <ntdef.h>
#undef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT
#include <ntddk.h> #include <ntddk.h>
#include <reactos/rossym.h> #include <reactos/rossym.h>
#include "rossympriv.h" #include "rossympriv.h"

View file

@ -14,15 +14,15 @@
/* DDK/IFS/NDK Headers */ /* DDK/IFS/NDK Headers */
#define _REALLY_GET_CALLERS_CALLER #define _REALLY_GET_CALLERS_CALLER
#ifdef _MSC_VER
#include <excpt.h> #include <excpt.h>
#include <ntdef.h> #include <ntdef.h>
#undef DECLSPEC_IMPORT #undef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT #define DECLSPEC_IMPORT
#endif
#include <ntifs.h> #include <ntifs.h>
#include <wdmguid.h> #include <wdmguid.h>
#include <arc/arc.h> #include <arc/arc.h>
#undef NTHALAPI
#define NTHALAPI __declspec(dllimport)
#include <ntndk.h> #include <ntndk.h>
#undef TEXT #undef TEXT
#define TEXT(s) L##s #define TEXT(s) L##s