diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2005-02-10 04:19:43 +0300 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2005-02-10 04:19:43 +0300 |
commit | 78a04600f9b2dac96b06e26a62fc34becdcc6ffb (patch) | |
tree | 2bf1721961a20b24ea5cf479af5d7658c52462b6 /winsup/w32api/lib/directx | |
parent | 9631b700f9943cfcbdef90dbbc14315368c6b15a (diff) |
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.
Diffstat (limited to 'winsup/w32api/lib/directx')
-rw-r--r-- | winsup/w32api/lib/directx/dinput_joy.c | 4 | ||||
-rw-r--r-- | winsup/w32api/lib/directx/dinput_joy2.c | 4 | ||||
-rw-r--r-- | winsup/w32api/lib/directx/dinput_kbd.c | 4 | ||||
-rw-r--r-- | winsup/w32api/lib/directx/dinput_mouse.c | 4 | ||||
-rw-r--r-- | winsup/w32api/lib/directx/dinput_mouse2.c | 4 | ||||
-rw-r--r-- | winsup/w32api/lib/directx/dinput_private.h | 8 |
6 files changed, 18 insertions, 10 deletions
diff --git a/winsup/w32api/lib/directx/dinput_joy.c b/winsup/w32api/lib/directx/dinput_joy.c index 6c88d575b..e2a6f9fce 100644 --- a/winsup/w32api/lib/directx/dinput_joy.c +++ b/winsup/w32api/lib/directx/dinput_joy.c @@ -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}; diff --git a/winsup/w32api/lib/directx/dinput_joy2.c b/winsup/w32api/lib/directx/dinput_joy2.c index 214e2161a..3c27abd33 100644 --- a/winsup/w32api/lib/directx/dinput_joy2.c +++ b/winsup/w32api/lib/directx/dinput_joy2.c @@ -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}; diff --git a/winsup/w32api/lib/directx/dinput_kbd.c b/winsup/w32api/lib/directx/dinput_kbd.c index b32d0a186..88cac861c 100644 --- a/winsup/w32api/lib/directx/dinput_kbd.c +++ b/winsup/w32api/lib/directx/dinput_kbd.c @@ -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}; diff --git a/winsup/w32api/lib/directx/dinput_mouse.c b/winsup/w32api/lib/directx/dinput_mouse.c index a4f8a312e..21e3e0380 100644 --- a/winsup/w32api/lib/directx/dinput_mouse.c +++ b/winsup/w32api/lib/directx/dinput_mouse.c @@ -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}; diff --git a/winsup/w32api/lib/directx/dinput_mouse2.c b/winsup/w32api/lib/directx/dinput_mouse2.c index 89e18a73d..90f46c01b 100644 --- a/winsup/w32api/lib/directx/dinput_mouse2.c +++ b/winsup/w32api/lib/directx/dinput_mouse2.c @@ -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}; diff --git a/winsup/w32api/lib/directx/dinput_private.h b/winsup/w32api/lib/directx/dinput_private.h index f620aa84b..e1629134a 100644 --- a/winsup/w32api/lib/directx/dinput_private.h +++ b/winsup/w32api/lib/directx/dinput_private.h @@ -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 |