OSDN Git Service

2005-02-10 Jiri Malak <Jiri.Malak@iol.cz>
authordannysmith <dannysmith>
Thu, 10 Feb 2005 01:19:42 +0000 (01:19 +0000)
committerdannysmith <dannysmith>
Thu, 10 Feb 2005 01:19:42 +0000 (01:19 +0000)
            Danny Smith  <dannysmith@users.sourceforge.net>

* lib/directx/dinput_private.h (ATTRIBUTE_TEXT_SECTION): New
define for Open Watcom portability.
* lib/directx/(dinput_joy.c, dinput_joy2.c, dinput_kbd.c,
dinput_mouse.c, dinput_mouse2.c): Use new macro in definition
of local c_rgodfDI* objects. Replace .rdata section attribute
with 'const' keyword in definition of global c_dfDI* objects.

winsup/w32api/ChangeLog
winsup/w32api/lib/directx/dinput_joy.c
winsup/w32api/lib/directx/dinput_joy2.c
winsup/w32api/lib/directx/dinput_kbd.c
winsup/w32api/lib/directx/dinput_mouse.c
winsup/w32api/lib/directx/dinput_mouse2.c
winsup/w32api/lib/directx/dinput_private.h

index c482972..7b36f52 100644 (file)
@@ -1,3 +1,13 @@
+2005-02-10  Jiri Malak  <Jiri.Malak@iol.cz>
+            Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * lib/directx/dinput_private.h (ATTRIBUTE_TEXT_SECTION): New
+       define for Open Watcom portability.
+       * lib/directx/(dinput_joy.c, dinput_joy2.c, dinput_kbd.c, 
+       dinput_mouse.c, dinput_mouse2.c): Use new macro in definition
+       of local c_rgodfDI* objects. Replace .rdata section attribute
+       with 'const' keyword in definition of global c_dfDI* objects.
+
 2005-02-07  Danny Smith  <dannysmith@users.sourceforge.net>
 
        * include/winioctl.h (IOCTL_VOLUME_BASE,
index 6c88d57..e2a6f9f 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "dinput_private.h"
 
-static DIOBJECTDATAFORMAT c_rgodfDIJoy[] __attribute__ ((section(".text"))) = 
+static DIOBJECTDATAFORMAT ATTRIBUTE_TEXT_SECTION  c_rgodfDIJoy[] = 
 {
        {&GUID_XAxis,0x0,DIDFT_ABSAXIS|DIDFT_RELAXIS|DIDFT_ANYINSTANCE|DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION},
        {&GUID_YAxis,0x4,DIDFT_ABSAXIS|DIDFT_RELAXIS|DIDFT_ANYINSTANCE|DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION},
@@ -60,4 +60,4 @@ static DIOBJECTDATAFORMAT c_rgodfDIJoy[] __attribute__ ((section(".text"))) =
        {NULL,0x4f,DIDFT_BUTTON|DIDFT_ANYINSTANCE|DIDFT_OPTIONAL,0x0}
 };
 
-DIDATAFORMAT c_dfDIJoystick __attribute__ ((section(".rdata"))) = {sizeof(DIDATAFORMAT),sizeof(DIOBJECTDATAFORMAT),DIDF_ABSAXIS,80,sizeof(c_rgodfDIJoy)/sizeof(c_rgodfDIJoy[0]),c_rgodfDIJoy};
+const DIDATAFORMAT c_dfDIJoystick = {sizeof(DIDATAFORMAT),sizeof(DIOBJECTDATAFORMAT),DIDF_ABSAXIS,80,sizeof(c_rgodfDIJoy)/sizeof(c_rgodfDIJoy[0]),c_rgodfDIJoy};
index 214e216..3c27abd 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "dinput_private.h"
 
-static DIOBJECTDATAFORMAT c_rgodfDIJoy2[] __attribute__ ((section(".text"))) =
+static DIOBJECTDATAFORMAT ATTRIBUTE_TEXT_SECTION c_rgodfDIJoy2[] =
 {
        {&GUID_XAxis,0x0,DIDFT_ABSAXIS|DIDFT_RELAXIS|DIDFT_ANYINSTANCE|DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION},
        {&GUID_YAxis,0x4,DIDFT_ABSAXIS|DIDFT_RELAXIS|DIDFT_ANYINSTANCE|DIDFT_OPTIONAL,DIDOI_ASPECTPOSITION},
@@ -180,4 +180,4 @@ static DIOBJECTDATAFORMAT c_rgodfDIJoy2[] __attribute__ ((section(".text"))) =
        {&GUID_Slider,0x1c,DIDFT_ABSAXIS|DIDFT_RELAXIS|DIDFT_ANYINSTANCE|DIDFT_OPTIONAL,DIDOI_ASPECTFORCE}
 };
 
-DIDATAFORMAT c_dfDIJoystick2 __attribute__ ((section(".rdata"))) = {sizeof(DIDATAFORMAT),sizeof(DIOBJECTDATAFORMAT),DIDF_ABSAXIS,272,sizeof(c_rgodfDIJoy2)/sizeof(c_rgodfDIJoy2[0]),c_rgodfDIJoy2};
+const DIDATAFORMAT c_dfDIJoystick2 = {sizeof(DIDATAFORMAT),sizeof(DIOBJECTDATAFORMAT),DIDF_ABSAXIS,272,sizeof(c_rgodfDIJoy2)/sizeof(c_rgodfDIJoy2[0]),c_rgodfDIJoy2};
index b32d0a1..88cac86 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "dinput_private.h"
 
-static DIOBJECTDATAFORMAT c_rgodfDIKeyboard[] __attribute__ ((section(".text"))) =
+static DIOBJECTDATAFORMAT ATTRIBUTE_TEXT_SECTION c_rgodfDIKeyboard[] =
 {
        {&GUID_Key,0x0,DIDFT_BUTTON|DIDFT_MAKEINSTANCE(0x0)|DIDFT_OPTIONAL,0x0},
        {&GUID_Key,0x1,DIDFT_BUTTON|DIDFT_MAKEINSTANCE(0x1)|DIDFT_OPTIONAL,0x0},
@@ -272,4 +272,4 @@ static DIOBJECTDATAFORMAT c_rgodfDIKeyboard[] __attribute__ ((section(".text")))
        {&GUID_Key,0xff,DIDFT_BUTTON|DIDFT_MAKEINSTANCE(0xff)|DIDFT_OPTIONAL,0x0}
 };
 
-DIDATAFORMAT c_dfDIKeyboard __attribute__ ((section(".rdata"))) = {sizeof(DIDATAFORMAT),sizeof(DIOBJECTDATAFORMAT),DIDF_RELAXIS,256,sizeof(c_rgodfDIKeyboard)/sizeof(c_rgodfDIKeyboard[0]),c_rgodfDIKeyboard};
+const DIDATAFORMAT c_dfDIKeyboard = {sizeof(DIDATAFORMAT),sizeof(DIOBJECTDATAFORMAT),DIDF_RELAXIS,256,sizeof(c_rgodfDIKeyboard)/sizeof(c_rgodfDIKeyboard[0]),c_rgodfDIKeyboard};
index a4f8a31..21e3e03 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "dinput_private.h"
 
-static DIOBJECTDATAFORMAT c_rgodfDIMouse[] __attribute__ ((section(".text"))) =
+static DIOBJECTDATAFORMAT ATTRIBUTE_TEXT_SECTION c_rgodfDIMouse[] =
 {
        {&GUID_XAxis,0x0,DIDFT_ABSAXIS|DIDFT_RELAXIS|DIDFT_ANYINSTANCE,0x0},
        {&GUID_YAxis,0x4,DIDFT_ABSAXIS|DIDFT_RELAXIS|DIDFT_ANYINSTANCE,0x0},
@@ -23,4 +23,4 @@ static DIOBJECTDATAFORMAT c_rgodfDIMouse[] __attribute__ ((section(".text"))) =
        {NULL,0xf,DIDFT_BUTTON|DIDFT_ANYINSTANCE|DIDFT_OPTIONAL,0x0}
 };
 
-DIDATAFORMAT c_dfDIMouse __attribute__ ((section(".rdata"))) = {sizeof(DIDATAFORMAT),sizeof(DIOBJECTDATAFORMAT),DIDF_RELAXIS,16,sizeof(c_rgodfDIMouse)/sizeof(c_rgodfDIMouse[0]),c_rgodfDIMouse};
+const DIDATAFORMAT c_dfDIMouse = {sizeof(DIDATAFORMAT),sizeof(DIOBJECTDATAFORMAT),DIDF_RELAXIS,16,sizeof(c_rgodfDIMouse)/sizeof(c_rgodfDIMouse[0]),c_rgodfDIMouse};
index 89e18a7..90f46c0 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "dinput_private.h"
 
-static DIOBJECTDATAFORMAT c_rgodfDIMouse2[] __attribute__ ((section(".text"))) =
+static DIOBJECTDATAFORMAT ATTRIBUTE_TEXT_SECTION c_rgodfDIMouse2[] =
 {
        {&GUID_XAxis,0x0,DIDFT_ABSAXIS|DIDFT_RELAXIS|DIDFT_ANYINSTANCE,0x0},
        {&GUID_YAxis,0x4,DIDFT_ABSAXIS|DIDFT_RELAXIS|DIDFT_ANYINSTANCE,0x0},
@@ -27,4 +27,4 @@ static DIOBJECTDATAFORMAT c_rgodfDIMouse2[] __attribute__ ((section(".text"))) =
        {NULL,0x13,DIDFT_BUTTON|DIDFT_ANYINSTANCE|DIDFT_OPTIONAL,0x0}
 };
 
-DIDATAFORMAT c_dfDIMouse2 __attribute__ ((section(".rdata"))) = {sizeof(DIDATAFORMAT),sizeof(DIOBJECTDATAFORMAT),DIDF_RELAXIS,20,sizeof(c_rgodfDIMouse2)/sizeof(c_rgodfDIMouse2[0]),c_rgodfDIMouse2};
+const DIDATAFORMAT c_dfDIMouse2 = {sizeof(DIDATAFORMAT),sizeof(DIOBJECTDATAFORMAT),DIDF_RELAXIS,20,sizeof(c_rgodfDIMouse2)/sizeof(c_rgodfDIMouse2[0]),c_rgodfDIMouse2};
index f620aa8..e162913 100644 (file)
@@ -70,4 +70,12 @@ extern GUID GUID_Slider;
 extern GUID GUID_Key;
 extern GUID GUID_POV;
 
+#if defined (__WATCOMC__)
+#define ATTRIBUTE_TEXT_SECTION __based( __segname( "_CODE" ) )
+#elif defined (__GNUC__)
+#define ATTRIBUTE_TEXT_SECTION  __attribute__ ((section(".text")))
+#else
+#define ATTRIBUTE_TEXT_SECTION
+#endif
+
 #endif