Skip to content

Commit 3ede569

Browse files
committed
Fix issues building on Solaris 10
1 parent a85d84e commit 3ede569

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ target_link_libraries(zone-bench PRIVATE zone)
169169
check_include_file(endian.h HAVE_ENDIAN_H)
170170

171171
check_include_file(unistd.h HAVE_UNISTD_H)
172-
check_symbol_exists(getopt unistd.h HAVE_GETOPT)
172+
check_symbol_exists(getopt "stdio.h;unistd.h" HAVE_GETOPT)
173173
if(NOT HAVE_UNISTD_H OR NOT HAVE_GETOPT)
174174
target_include_directories(
175175
zone-bench PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/compat>)

src/attributes.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,13 @@
6464
# define no_sanitize_undefined
6565
# endif
6666

67-
# define likely(params) __builtin_expect(!!(params), 1)
68-
# define unlikely(params) __builtin_expect(!!(params), 0)
67+
# if has_builtin(__builtin_expect)
68+
# define likely(params) __builtin_expect(!!(params), 1)
69+
# define unlikely(params) __builtin_expect(!!(params), 0)
70+
# else
71+
# define likely(params) (params)
72+
# define unlikely(params) (params)
73+
# endif
6974
#endif
7075

7176
#endif // ATTRIBUTES_H

src/config.h.in

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* Wether or not we have getopt */
2+
#undef HAVE_GETOPT
3+
14
/* Wether or not have the <endian.h> header file */
25
#undef HAVE_ENDIAN_H
36

0 commit comments

Comments
 (0)