summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2013-05-17 16:59:02 -0400
committerAlon Levy <alon@pobox.com>2013-05-17 16:59:02 -0400
commitdad01064dfe09b5fdce6875c4a42ee8c634da008 (patch)
tree26dbe752a57c38a95373d4859c299165b98b9b72
parent9637c1362facf515fe8a9c26a3b339598183bffc (diff)
driver builds with both mingw and ddk
-rw-r--r--xddm/miniport/qxl.c15
-rw-r--r--xddm/miniport/qxl.h9
2 files changed, 19 insertions, 5 deletions
diff --git a/xddm/miniport/qxl.c b/xddm/miniport/qxl.c
index 4f0c9fa..961110d 100644
--- a/xddm/miniport/qxl.c
+++ b/xddm/miniport/qxl.c
@@ -26,11 +26,11 @@
#endif
#include "minimal_snprintf.h"
+#ifdef __GNUC__
#define PCI_TYPE0_ADDRESSES 6
#define PCI_TYPE1_ADDRESSES 2
#define PCI_TYPE2_ADDRESSES 5
-#ifdef __GNUC__
/* While MS WDK uses inheritance in C++, we cannot do this with gcc, as
inheritance, even from a struct renders the type non-POD. So we use
this hack */
@@ -115,8 +115,6 @@ typedef struct _PCI_COMMON_CONFIG {
UCHAR DeviceSpecific[192];
};
} PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG;
-#else
-#error not done yet
#endif
VP_STATUS FindAdapter(PVOID dev_extension,
@@ -234,12 +232,19 @@ void DebugPrint(QXLExtension *dev, UINT32 level, const char *message, const char
# define G_STRUCT_OFFSET(struct_type, member) \
((long) ((unsigned char*) &((struct_type*) 0)->member))
+#ifdef __GNUC__
ULONG NTAPI DriverEntry(PVOID context1, PVOID context2)
+#else
+ULONG DriverEntry(PVOID context1, PVOID context2)
+#endif
{
VIDEO_HW_INITIALIZATION_DATA init_data;
ULONG ret;
- DbgPrint("DriverEntry size:%d %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n", sizeof(VIDEO_HW_INITIALIZATION_DATA),
+ DEBUG_PRINT((NULL, 0,
+ "DriverEntry size:%d %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
+ __FUNCTION__,
+ sizeof(VIDEO_HW_INITIALIZATION_DATA),
G_STRUCT_OFFSET (VIDEO_HW_INITIALIZATION_DATA, HwInitDataSize),
G_STRUCT_OFFSET (VIDEO_HW_INITIALIZATION_DATA, AdapterInterfaceType),
G_STRUCT_OFFSET (VIDEO_HW_INITIALIZATION_DATA, HwFindAdapter),
@@ -260,7 +265,7 @@ ULONG NTAPI DriverEntry(PVOID context1, PVOID context2)
G_STRUCT_OFFSET (VIDEO_HW_INITIALIZATION_DATA, HwLegacyResourceCount),
G_STRUCT_OFFSET (VIDEO_HW_INITIALIZATION_DATA, HwGetLegacyResources),
G_STRUCT_OFFSET (VIDEO_HW_INITIALIZATION_DATA, AllowEarlyEnumeration),
- G_STRUCT_OFFSET (VIDEO_HW_INITIALIZATION_DATA, Reserved));
+ G_STRUCT_OFFSET (VIDEO_HW_INITIALIZATION_DATA, Reserved)));
PAGED_CODE();
diff --git a/xddm/miniport/qxl.h b/xddm/miniport/qxl.h
index 53480c0..ad2bd86 100644
--- a/xddm/miniport/qxl.h
+++ b/xddm/miniport/qxl.h
@@ -19,6 +19,7 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
+#ifdef __GNUC__
#include <ntdef.h>
#include <windef.h>
#include <miniport.h>
@@ -27,6 +28,14 @@
#include "winerror.h"
#include "devioctl.h"
#include "ntddvdeo.h"
+#else
+#include "winerror.h"
+#include "devioctl.h"
+#include "miniport.h"
+#include "ntddvdeo.h"
+#include "video.h"
+#endif
+
#include "qxl_driver.h"