diff --git a/include/QF/qendian.h b/include/QF/qendian.h index 61700a91c..e6d27f47f 100644 --- a/include/QF/qendian.h +++ b/include/QF/qendian.h @@ -53,13 +53,21 @@ //============================================================================ -extern qboolean bigendien; -extern short (*BigShort) (short l); -extern short (*LittleShort) (short l); -extern int (*BigLong) (int l); -extern int (*LittleLong) (int l); -extern float (*BigFloat) (float l); -extern float (*LittleFloat) (float l); +#ifndef WORDS_BIGENDIAN +#define BigShort ShortSwap +#define LittleShort ShortNoSwap +#define BigLong LongSwap +#define LittleLong LongNoSwap +#define BigFloat FloatSwap +#define LittleFloat FloatNoSwap +#else +#define BigShort ShortNoSwap +#define LittleShort ShortSwap +#define BigLong LongNoSwap +#define LittleLong LongSwap +#define BigFloat FloatNoSwap +#define LittleFloat FloatSwap +#endif short ShortSwap (short l); short ShortNoSwap (short l); diff --git a/libs/util/qendian.c b/libs/util/qendian.c index 0793642f5..11746c5be 100644 --- a/libs/util/qendian.c +++ b/libs/util/qendian.c @@ -45,20 +45,8 @@ static __attribute__ ((unused)) const char rcsid[] = #ifndef WORDS_BIGENDIAN qboolean bigendien = false;; -short (*BigShort) (short l) = ShortSwap; -short (*LittleShort) (short l) = ShortNoSwap; -int (*BigLong) (int l) = LongSwap; -int (*LittleLong) (int l) = LongNoSwap; -float (*BigFloat) (float l) = FloatSwap; -float (*LittleFloat) (float l) = FloatNoSwap; #else qboolean bigendien = true;; -short (*BigShort) (short l) = ShortNoSwap; -short (*LittleShort) (short l) = ShortSwap; -int (*BigLong) (int l) = LongNoSwap; -int (*LittleLong) (int l) = LongSwap; -float (*BigFloat) (float l) = FloatNoSwap; -float (*LittleFloat) (float l) = FloatSwap; #endif