File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -341,6 +341,10 @@ endif()
341341# link compat
342342use_compat ()
343343
344+ if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS" )
345+ add_compile_definitions (__EXTENSIONS__ )
346+ endif ()
347+
344348# create static libyang library
345349if (NOT BUILD_SHARED_LIBS )
346350 add_definitions (-DSTATIC )
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ macro(USE_COMPAT)
6161
6262 check_include_file ("alloca.h" HAVE_ALLOCA_H )
6363
64+ check_include_file ("byteswap.h" HAVE_BYTESWAP_H )
65+
6466 list (REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=200809L)
6567 list (REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
6668 list (REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D__BSD_VISIBLE=1)
Original file line number Diff line number Diff line change 2626# include <alloca.h>
2727#endif
2828
29- #if defined (__APPLE__ ) || defined (_WIN32 )
29+ #cmakedefine HAVE_BYTESWAP_H
30+ #ifdef HAVE_BYTESWAP_H
31+ # include <byteswap.h>
32+ #else
3033# define bswap_32 __builtin_bswap32
3134# define bswap64 __builtin_bswap64
32- #else
33- # include <byteswap.h>
3435#endif
3536
3637#include <limits.h>
You can’t perform that action at this time.
0 commit comments