glide2x/h3 (linhwc.c/minihwc.c): fix fenceVar with newer gcc versions.

from glide3x tree.
This commit is contained in:
sezero
2018-08-04 17:14:20 +03:00
parent 486276471e
commit ae760389ae
2 changed files with 18 additions and 2 deletions

View File

@@ -63,7 +63,15 @@ hwcCheckMemSize(hwcBoardInfo *bInfo, FxU32 xres, FxU32 yres, FxU32 nColBuffers,
#include <X11/extensions/xf86dga.h>
#include <X11/extensions/xf86vmode.h>
static FxU32 fenceVar;
#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
# define __attribute_used __attribute__((__used__))
#elif defined(__GNUC__) && (__GNUC__ >= 2)
# define __attribute_used __attribute__((__unused__))
#else
# define __attribute_used
#endif
static FxU32 __attribute_used fenceVar;
#define P6FENCE asm("xchg %%eax, %0" : : "m" (fenceVar) : "eax");
#define MAXFIFOSIZE 0x40000

View File

@@ -441,10 +441,18 @@
#define MAXFIFOSIZE 0x40000
#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
# define __attribute_used __attribute__((__used__))
#elif defined(__GNUC__) && (__GNUC__ >= 2)
# define __attribute_used __attribute__((__unused__))
#else
# define __attribute_used
#endif
static hwcInfo hInfo;
static char errorString[1024];
static int num_monitor = 0;
static FxU32 fenceVar;
static FxU32 __attribute_used fenceVar;
#if defined(__WATCOMC__)