- Fix myoffsetof using misaligned pointer access.

That could be a problem for particularly pedantic platforms.
This commit is contained in:
Edoardo Prezioso 2016-06-21 12:44:03 +02:00 committed by Christoph Oelckers
parent 593e2f7641
commit 4defb6e967

View file

@ -16,7 +16,7 @@
#include <stdarg.h>
// the dec offsetof macro doesnt work very well...
#define myoffsetof(type,identifier) ((size_t)&((type *)1)->identifier - 1)
#define myoffsetof(type,identifier) ((size_t)&((type *)alignof(type))->identifier - alignof(type))
int Q_filelength (FILE *f);
bool FileExists (const char *filename);