cmake: add _U_ and NGHTTP2_NORETURN to config.h
Do not add _U_ and NGHTTP2_NORETURN definitions to the command line, instead add it to config.h. This matches what autotools does.
This commit is contained in:
parent
0c49e5d56e
commit
f8a9a21428
|
@ -118,12 +118,11 @@ endforeach()
|
||||||
# XXX - similar hints for other compilers?
|
# XXX - similar hints for other compilers?
|
||||||
#
|
#
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
add_definitions(
|
set(HINT_UNUSED_PARAM "__attribute__((unused))")
|
||||||
"-D_U_=__attribute__((unused))"
|
set(HINT_NORETURN "__attribute__((noreturn))")
|
||||||
"-DNGHTTP2_NORETURN=__attribute__((noreturn))"
|
|
||||||
)
|
|
||||||
else()
|
else()
|
||||||
add_definitions(-D_U_ -DNGHTTP2_NORETURN)
|
set(HINT_UNUSED_PARAM)
|
||||||
|
set(HINT_NORETURN)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(ExtractValidFlags)
|
include(ExtractValidFlags)
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
|
|
||||||
|
/* Hint to the compiler that a function parameter is not used */
|
||||||
|
#define _U_ @HINT_UNUSED_PARAM@
|
||||||
|
|
||||||
|
/* Hint to the compiler that a function never returns */
|
||||||
|
#define NGHTTP2_NORETURN @HINT_NORETURN@
|
||||||
|
|
||||||
/* Define to 1 if you have the `std::map::emplace`. */
|
/* Define to 1 if you have the `std::map::emplace`. */
|
||||||
#cmakedefine HAVE_STD_MAP_EMPLACE 1
|
#cmakedefine HAVE_STD_MAP_EMPLACE 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue