Skip to content

Commit

Permalink
cmod: Workaround 64-bit vector-optimized builds crashing while loadin…
Browse files Browse the repository at this point in the history
…g bsps with unaligned lumps
  • Loading branch information
Chomenor committed Sep 6, 2017
1 parent 178b8db commit bb87bea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/cmod/cmod_defs.h
Expand Up @@ -69,3 +69,4 @@
#define CMOD_REDUCE_WARNINGS
#define CMOD_EVENT_QUEUE_SIZE
#define CMOD_VM_STRNCPY_FIX
#define CMOD_CM_ALIGN_FIX
7 changes: 7 additions & 0 deletions code/qcommon/cm_load.c
Expand Up @@ -23,6 +23,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#include "cm_local.h"

#ifdef CMOD_CM_ALIGN_FIX
// Workaround for some wacky bsps that don't use 4-byte aligned structures
#undef LittleLong
static __attribute__ ((noinline)) unsigned int LittleLong(unsigned int x) {
return x; }
#endif

#ifdef BSPC

#include "../bspc/l_qfiles.h"
Expand Down

0 comments on commit bb87bea

Please sign in to comment.