diff --git a/include/QF/mathlib.h b/include/QF/mathlib.h index 6bde9100e..90cae258c 100644 --- a/include/QF/mathlib.h +++ b/include/QF/mathlib.h @@ -36,18 +36,8 @@ # define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif -#ifdef _WIN32 -# if defined (DLL_EXPORT) && defined (BUILD_QFutil) -# define QFutil_IMPORT -# else -# define QFutil_IMPORT __declspec(dllimport) -# endif -#else -# define QFutil_IMPORT -#endif - extern int nanmask; -extern QFutil_IMPORT const vec3_t vec3_origin; +extern const vec_t * const vec3_origin; #define EQUAL_EPSILON 0.001 #define RINT(x) (floor ((x) + 0.5)) @@ -148,7 +138,7 @@ void RotatePointAroundVector (vec3_t dst, const vec3_t axis, #define PlaneDiff(point,plane) (((plane)->type < 3 ? (point)[(plane)->type] : DotProduct((point), (plane)->normal)) - (plane)->dist) -extern QFutil_IMPORT mplane_t frustum[4]; +extern mplane_t * const frustum; extern inline qboolean R_CullBox (const vec3_t mins, const vec3_t maxs); extern inline qboolean R_CullSphere (const vec3_t origin, const float radius); extern inline float VectorNormalize (vec3_t v); // returns vector length diff --git a/libs/util/Makefile.am b/libs/util/Makefile.am index c5381c32d..1bbb0da27 100644 --- a/libs/util/Makefile.am +++ b/libs/util/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS= foreign -AM_CFLAGS= @PREFER_PIC@ -DBUILD_QFutil -AM_CCASFLAGS= @PREFER_PIC@ -DBUILD_QFutil +AM_CFLAGS= @PREFER_PIC@ +AM_CCASFLAGS= @PREFER_PIC@ INCLUDES= -I$(top_srcdir)/include lib_LTLIBRARIES= libQFutil.la diff --git a/libs/util/mathlib.c b/libs/util/mathlib.c index 6e2c32b98..cd736873d 100644 --- a/libs/util/mathlib.c +++ b/libs/util/mathlib.c @@ -48,8 +48,10 @@ static __attribute__ ((unused)) const char rcsid[] = #include "QF/sys.h" int nanmask = 255 << 23; -mplane_t frustum[4]; -const vec3_t vec3_origin = { 0, 0, 0 }; +static mplane_t _frustum[4]; +mplane_t *const frustum = _frustum; +static vec3_t _vec3_origin = { 0, 0, 0 }; +const vec_t * const vec3_origin = _vec3_origin; #define DEG2RAD(a) (a * (M_PI / 180.0))