From 7c7fa25c0a44a4e478c06ffc6130e56cb1e27d92 Mon Sep 17 00:00:00 2001 From: riccardom Date: Tue, 5 Jul 2011 07:33:10 +0000 Subject: [PATCH] Rename ALIGN macro do DS_ALIGN Anthony J. Bentley reports that desmume does not compile on OpenBSD when the hud is enabled in bug #3148356. After a few he reports that Stuart Henderson of OpenBSD found the problem. The macro definition of ALIGN() conflicts with a definition in /usr/include/machine/param.h. So rename ALIGN macro to DS_ALIGN. --- desmume/src/OGLRender.cpp | 2 +- desmume/src/gfx3d.cpp | 2 +- desmume/src/types.h | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index b17c37b19..e7956b617 100644 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -79,7 +79,7 @@ static void ENDGL() { #include "shaders.h" #include "texcache.h" -static ALIGN(16) u8 GPU_screen3D [256*192*4]; +static DS_ALIGN(16) u8 GPU_screen3D [256*192*4]; static const unsigned short map3d_cull[4] = {GL_FRONT_AND_BACK, GL_FRONT, GL_BACK, 0}; static const int texEnv[4] = { GL_MODULATE, GL_DECAL, GL_MODULATE, GL_MODULATE }; diff --git a/desmume/src/gfx3d.cpp b/desmume/src/gfx3d.cpp index b9ba116aa..3446bfcd2 100644 --- a/desmume/src/gfx3d.cpp +++ b/desmume/src/gfx3d.cpp @@ -590,7 +590,7 @@ static void SetVertex() s16coord[2] }; - ALIGN(16) s32 coordTransformed[4] = { coord[0], coord[1], coord[2], (1<<12) }; + DS_ALIGN(16) s32 coordTransformed[4] = { coord[0], coord[1], coord[2], (1<<12) }; if (texCoordinateTransform == 3) { diff --git a/desmume/src/types.h b/desmume/src/types.h index 7e95b0b60..4825f3afc 100644 --- a/desmume/src/types.h +++ b/desmume/src/types.h @@ -82,17 +82,17 @@ #if defined(_MSC_VER) || defined(__INTEL_COMPILER) -#define ALIGN(X) __declspec(align(X)) +#define DS_ALIGN(X) __declspec(align(X)) #elif defined(__GNUC__) -#define ALIGN(X) __attribute__ ((aligned (X))) +#define DS_ALIGN(X) __attribute__ ((aligned (X))) #else -#define ALIGN(X) +#define DS_ALIGN(X) #endif -#define CACHE_ALIGN ALIGN(32) +#define CACHE_ALIGN DS_ALIGN(32) //use this for example when you want a byte value to be better-aligned -#define FAST_ALIGN ALIGN(4) +#define FAST_ALIGN DS_ALIGN(4) #ifndef FASTCALL #ifdef __MINGW32__