[email protected]

"Jiri Malak" <[email protected]> Fri, 20 Jan 2006 22:10:58 +0100
Newsgroups gmane.comp.gnu.mingw.patches
Message-ID <003e01c61e06$0280a460$0100a8c0@jirkaml>
This is a multi-part message in MIME format.

------=_NextPart_000_003B_01C61E0E.64080360
Content-Type: text/plain;
	format=flowed;
	charset="iso-8859-2";
	reply-type=original
Content-Transfer-Encoding: 7bit

I enclosed patch for porting DDK headers for Open Watcom compilers.
It adds conditional blocks for compilers specific declaration.

Regards

Jiri Malak

2006-01-20  Jiri Malak  <[email protected]>

     * include/ddk/(ntddk.h, winddk.h) : fix
     for Open Watcom compiler.


------=_NextPart_000_003B_01C61E0E.64080360
Content-Type: text/plain;
	format=flowed;
	name="patch_win32api.txt";
	reply-type=original
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="patch_win32api.txt"

--- ntddk.h	15 Oct 2004 01:18:11 -0000	1.6
+++ ntddk.h	20 Jan 2006 20:56:02 -0000
@@ -58,6 +58,8 @@
 #define CALLBACK
 #endif
 
+#if defined( __GNUC__ )
+
 #ifndef DECL_IMPORT
 #define DECL_IMPORT __attribute__((dllimport))
 #endif
@@ -66,6 +68,18 @@
 #define DECL_EXPORT __attribute__((dllexport))
 #endif
 
+#elif defined( __WATCOMC__ )
+
+#ifndef DECL_IMPORT
+#define DECL_IMPORT __declspec(dllimport)
+#endif
+
+#ifndef DECL_EXPORT
+#define DECL_EXPORT __declspec(dllexport)
+#endif
+
+#endif
+
 /* Windows NT status codes */
 #include "ntstatus.h"


 

--- winddk.h	12 Nov 2004 08:26:44 -0000	1.24
+++ winddk.h	20 Jan 2006 20:56:14 -0000
@@ -34,9 +34,15 @@
 /*
 ** Definitions specific to this Device Driver Kit
 */
+#if defined( __GNUC__ )
 #define DDKAPI __attribute__((stdcall))
 #define DDKFASTAPI __attribute__((fastcall))
 #define DDKCDECLAPI __attribute__((cdecl))
+#elif defined( __WATCOMC__ )
+#define DDKAPI __stdcall
+#define DDKFASTAPI __fastcall
+#define DDKCDECLAPI __cdecl
+#endif
 
 #if defined(_NTOSKRNL_)
 #ifndef NTOSAPI
@@ -114,6 +120,8 @@
 #define TAG(_a, _b, _c, _d) (ULONG) \
 	(((_a) << 0) + ((_b) << 8) + ((_c) << 16) + ((_d) << 24))
 
+#if defined( __GNUC__ )
+
 static __inline struct _KPCR * KeGetCurrentKPCR(
   VOID)
 {
@@ -126,6 +134,15 @@
   return (struct _KPCR *) Value;
 }
 
+#elif defined( __WATCOMC__ )
+
+extern struct _KPCR * KeGetCurrentKPCR( void );
+#pragma aux KeGetCurrentKPCR = \
+  "mov eax, fs:[0x18]" \
+  value [ eax ];
+
+#endif
+
 /*
 ** Simple structures
 */

------=_NextPart_000_003B_01C61E0E.64080360--



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642