Use ATTRIBUTE((used)) for symbols used only in inline asm.

This may fix compilation for optimized builds with GCC or clang where
the compiler would otherwise decide that those symbols are unused.

git-svn-id: https://svn.eduke32.com/eduke32@2271 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-01-20 13:23:53 +00:00
parent d0acd40ff8
commit db94366657
2 changed files with 3 additions and 17 deletions

View file

@ -142,7 +142,7 @@ static int32_t artsize = 0, cachesize = 0;
static char *artptrs[MAXTILEFILES];
static int16_t radarang2[MAXXDIM];
static uint16_t sqrtable[4096], shlookup[4096+256];
static uint16_t ATTRIBUTE((used)) sqrtable[4096], ATTRIBUTE((used)) shlookup[4096+256];
char pow2char[8] = {1,2,4,8,16,32,64,128};
int32_t pow2long[32] =
{
@ -1815,13 +1815,6 @@ int32_t checksectorpointer(int16_t i, int16_t sectnum)
#undef WALLS_ARE_CONSISTENT
#ifdef __clang__
int32_t engine_dummy_function_to_keep_symbols(void)
{
return shlookup[0] | sqrtable[0];
}
#endif
#if defined(_MSC_VER) && !defined(NOASM)

View file

@ -174,13 +174,13 @@ static int32_t bakr = 0x80, bakg = 0x80, bakb = 0x80; //this used to be public..
static int32_t gslidew = 0, gslider = 0, xm, xmn[4], xr0, xr1, xplc, yplc;
static intptr_t nfplace;
static int32_t clen[320], cclen[19], bitpos, filt, xsiz, ysiz;
static int32_t xsizbpl, ixsiz, ixoff, iyoff, ixstp, iystp, intlac, nbpl, trnsrgb ASMNAME("trnsrgb");
static int32_t xsizbpl, ixsiz, ixoff, iyoff, ixstp, iystp, intlac, nbpl, ATTRIBUTE((used)) trnsrgb ASMNAME("trnsrgb");
static int32_t ccind[19] = {16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15};
static int32_t hxbit[59][2], ibuf0[288], nbuf0[32], ibuf1[32], nbuf1[32];
static const uint8_t *filptr;
static uint8_t slidebuf[32768], opixbuf0[4], opixbuf1[4];
static uint8_t pnginited = 0, olinbuf[131072] ASMNAME("olinbuf"); //WARNING:max xres is: 131072/bpp-1
static int32_t gotcmov = -2, abstab10[1024] ASMNAME("abstab10");
static int32_t gotcmov = -2, ATTRIBUTE((used)) abstab10[1024] ASMNAME("abstab10");
//Variables to speed up dynamic Huffman decoding:
#define LOGQHUFSIZ0 9
@ -188,13 +188,6 @@ static int32_t gotcmov = -2, abstab10[1024] ASMNAME("abstab10");
static int32_t qhufval0[1<<LOGQHUFSIZ0], qhufval1[1<<LOGQHUFSIZ1];
static uint8_t qhufbit0[1<<LOGQHUFSIZ0], qhufbit1[1<<LOGQHUFSIZ1];
#ifdef __clang__
int32_t kplib_dummy_function_to_keep_symbols(void)
{
return abstab10[0] | trnsrgb;
}
#endif
#if defined(_MSC_VER) && !defined(NOASM)
static _inline uint32_t bswap(uint32_t a)