mirror of
https://github.com/fmang/opustags.git
synced 2025-01-28 19:05:03 +01:00
Include endian.h or sys/endian.h depending on the platform
This commit is contained in:
parent
b8c8be453f
commit
30b7f44ead
@ -21,6 +21,11 @@ link_directories(${OGG_LIBRARY_DIRS})
|
||||
|
||||
include(FindIconv)
|
||||
|
||||
# We need endian.h on Linux, and sys/endian.h on BSD.
|
||||
include(CheckIncludeFileCXX)
|
||||
check_include_file_cxx(endian.h HAVE_ENDIAN_H)
|
||||
check_include_file_cxx(sys/endian.h HAVE_SYS_ENDIAN_H)
|
||||
|
||||
configure_file(src/config.h.in config.h @ONLY)
|
||||
include_directories(BEFORE src "${CMAKE_BINARY_DIR}" ${OGG_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS})
|
||||
|
||||
|
@ -1,2 +1,5 @@
|
||||
#cmakedefine PROJECT_NAME "@PROJECT_NAME@"
|
||||
#cmakedefine PROJECT_VERSION "@PROJECT_VERSION@"
|
||||
|
||||
#cmakedefine HAVE_ENDIAN_H @HAVE_ENDIAN_H@
|
||||
#cmakedefine HAVE_SYS_ENDIAN_H @HAVE_SYS_ENDIAN_H@
|
||||
|
@ -25,6 +25,14 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
# include <endian.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_ENDIAN_H
|
||||
# include <sys/endian.h>
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <libkern/OSByteOrder.h>
|
||||
#define htole32(x) OSSwapHostToLittleInt32(x)
|
||||
|
Loading…
x
Reference in New Issue
Block a user