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.
This commit is contained in:
Danny Smith 2005-02-10 01:19:43 +00:00
parent 9631b700f9
commit 78a04600f9
7 changed files with 28 additions and 10 deletions

View 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,

View 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};

View 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};

View 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};

View 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};

View 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};

View 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