Commit Graph

12 Commits

Author SHA1 Message Date
Darik Horn
a0cf85e536 Adjust byte-swapping macros for MinGW builds.
Cygwin does not implement endian.h features for MinGW targets, but
defines both of the  __CYGWIN__ and __MINGW32__ identifiers and some
MSVC idioms.
2017-05-12 13:08:26 -04:00
wjpyle
c5f5f5166a Fix compilation on MSC, and some help on BSD 2017-04-30 00:11:55 -04:00
Martin Lindhe
99a52db519 fix compilation on macOS
first, avoid include <endian.h> which is not found on macOS, fixes:

    g++ -DHAVE_CONFIG_H -I. -I../..  -I../../include -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/usr/local/include  -g -O2 -Wall -mmmx -msse -msse2 -D_FILE_OFFSET_BITS=64 -Wno-strict-aliasing  -std=gnu++11   -c -o callback.o callback.cpp
    In file included from callback.cpp:24:
    In file included from ../../include/callback.h:24:
    ../../include/mem.h:34:11: fatal error: 'endian.h' file not found
    # include <endian.h>

next, map some missing functions to macOS eqivalents, based on
https://gist.github.com/yinyin/2027912, fixes:

    ../../include/mem.h:115:9: error: use of undeclared identifier 'le16toh'
            return le16toh((*(Bit16u *)off)); // BSD endian.h
                   ^
    ../../include/mem.h:118:9: error: use of undeclared identifier 'le32toh'
            return le32toh((*(Bit32u *)off)); // BSD endian.h
                   ^
    ../../include/mem.h:121:9: error: use of undeclared identifier 'le64toh'
            return le64toh((*(Bit64u *)off)); // BSD endian.h
                   ^
    ../../include/mem.h:128:21: error: use of undeclared identifier 'htole16'
            *(Bit16u *)(off) = htole16(val);
                               ^
    ../../include/mem.h:131:21: error: use of undeclared identifier 'htole32'
            *(Bit32u *)(off) = htole32(val);
                               ^
    ../../include/mem.h:134:21: error: use of undeclared identifier 'htole64'
            *(Bit64u *)(off) = htole64(val);
                               ^
2017-04-08 00:21:11 +02:00
Jonathan Campbell
e3e1cca292 reminder for anyone who wants to compile this for Windows. 2016-06-12 10:43:17 -07:00
Jonathan Campbell
8cb3c035f8 use BSD endian.h functions to consolidate host ptr access down to simply
C_UNALIGNED_MEMORY or not. Make unaligned memory access layered to
simplify code.
2016-06-12 10:40:47 -07:00
Jonathan Campbell
691a4702cb 64-bit host read/write and var_write. 2016-06-12 10:23:43 -07:00
Jonathan Campbell
ac0dae8571 memory allocation now has A20-friendly variants. memory allocated by
these functions is guaranteed to exist within an even megabyte (20th
address bit == 0).
2015-12-26 19:41:45 -08:00
Jonathan Campbell
ffbad0b2b3 svn mainline r3878:
Year update.
2015-01-25 21:13:25 -08:00
Jonathan Campbell
f865b17697 provide some useful typedefs 2014-06-27 23:37:33 -07:00
Jonathan Campbell
f9a5bf9715 cleanup 2014-06-10 18:28:44 -07:00
Jonathan Campbell
21614b8c3f toss out my copy, integrate tawoongs's daum branch code into mine,
remove what won't compile, begin work.
2013-10-14 05:07:26 -07:00
root
f331824031 port from svn 2013-07-07 20:39:49 -07:00