mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-15 00:34:05 +09:00
fix for FreeBSD and other BSD's where endian.h becomes sys/endian.h
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.4.1)
|
||||
include_directories( playfair llhttp )
|
||||
|
||||
INCLUDE (CheckIncludeFiles)
|
||||
# for BSD Unix (e.g. FreeBSD)
|
||||
CHECK_INCLUDE_FILES ("sys/endian.h" HAVE_SYS_ENDIAN_H )
|
||||
if (HAVE_SYS_ENDIAN_H)
|
||||
add_definitions( -DSYS_ENDIAN_H )
|
||||
endif (HAVE_SYS_ENDIAN_H)
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Ofast -march=native -DSTANDALONE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -D_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -Wall -g")
|
||||
|
||||
if( APPLE )
|
||||
|
||||
@@ -17,7 +17,11 @@
|
||||
#include "byteutils.h"
|
||||
|
||||
#ifndef htonll
|
||||
#ifdef SYS_ENDIAN_H
|
||||
#include <sys/endian.h>
|
||||
#else
|
||||
#include <endian.h>
|
||||
#endif
|
||||
#define htonll(x) htobe64(x)
|
||||
#define ntohll(x) be64toh(x)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user