Skip to content

Commit

Permalink
Fix #if macros for idx64 and id386
Browse files Browse the repository at this point in the history
  • Loading branch information
Thilo Schulz committed Jun 15, 2011
1 parent a503584 commit a447aa8
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 47 deletions.
2 changes: 1 addition & 1 deletion code/asm/qasm-inline.h
Expand Up @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#include "../qcommon/q_platform.h"

#ifdef idx64
#if idx64
#define EAX "%%rax"
#define EBX "%%rbx"
#define ESP "%%rsp"
Expand Down
10 changes: 5 additions & 5 deletions code/qcommon/common.c
Expand Up @@ -90,9 +90,9 @@ cvar_t *com_basegame;
cvar_t *com_homepath;
cvar_t *com_busyWait;

#if defined(idx64)
#if idx64
void (*Q_VMftol)(void);
#elif defined(id386)
#elif id386
long (QDECL *Q_ftol)(float f);
void (QDECL *Q_VMftol)(void);
void (QDECL *Q_SnapVector)(vec3_t vec);
Expand Down Expand Up @@ -2580,11 +2580,11 @@ Find out whether we have SSE support for Q_ftol function
=================
*/

#if defined(id386) || defined(idx64)
#if id386 || idx64

static void Com_DetectSSE(void)
{
#ifndef idx64
#if !idx64
cpuFeatures_t feat;

feat = Sys_GetProcessorFeatures();
Expand All @@ -2601,7 +2601,7 @@ static void Com_DetectSSE(void)
Q_VMftol = qvmftolsse;

Com_Printf("Have SSE support\n");
#ifndef idx64
#if !idx64
}
else
{
Expand Down
14 changes: 10 additions & 4 deletions code/qcommon/q_platform.h
Expand Up @@ -24,6 +24,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define __Q_PLATFORM_H

// this is for determining if we have an asm version of a C function
#define idx64 0

#ifdef Q3_VM

#define id386 0
Expand Down Expand Up @@ -76,7 +78,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#if defined(_WIN64) || defined(__WIN64__)

#define idx64
#undef idx64
#define idx64 1

#undef QDECL
#define QDECL __cdecl
Expand Down Expand Up @@ -146,7 +149,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define ARCH_STRING "i386"
#define Q3_LITTLE_ENDIAN
#elif defined __x86_64__
#define idx64
#undef idx64
#define idx64 1
#define ARCH_STRING "x86_64"
#define Q3_LITTLE_ENDIAN
#endif
Expand All @@ -173,7 +177,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#if defined __i386__
#define ARCH_STRING "i386"
#elif defined __x86_64__
#define idx64
#undef idx64
#define idx64 1
#define ARCH_STRING "x86_64"
#elif defined __powerpc64__
#define ARCH_STRING "ppc64"
Expand Down Expand Up @@ -236,7 +241,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifdef __i386__
#define ARCH_STRING "i386"
#elif defined __amd64__
#define idx64
#undef idx64
#define idx64 1
#define ARCH_STRING "amd64"
#elif defined __axp__
#define ARCH_STRING "alpha"
Expand Down
4 changes: 2 additions & 2 deletions code/qcommon/q_shared.h
Expand Up @@ -421,7 +421,7 @@ extern vec3_t axisDefault[3];

int Q_isnan(float x);

#ifdef idx64
#if idx64
extern long qftolsse(float f);
extern void qvmftolsse(void);
extern void qsnapvectorsse(vec3_t vec);
Expand All @@ -430,7 +430,7 @@ int Q_isnan(float x);
#define Q_SnapVector qsnapvectorsse

extern void (*Q_VMftol)(void);
#elif defined(id386)
#elif id386
extern long QDECL qftolx87(float f);
extern long QDECL qftolsse(float f);
extern void QDECL qvmftolx87(void);
Expand Down

0 comments on commit a447aa8

Please sign in to comment.