diff options
author | Gaspard Petit <gaspardpetit@gmail.com> | 2022-06-01 13:30:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-01 19:30:07 +0200 |
commit | e20a979a4220f03ed3c4b8ef15e314b6e20cf86b (patch) | |
tree | 92faf4828cbc4ac14a0f404f3b0b92b262815b64 | |
parent | da5f846dcfec5dca44c1b2dc3d1cfb0740e4a35c (diff) | |
download | uriparser-e20a979a4220f03ed3c4b8ef15e314b6e20cf86b.tar.gz |
Include config.h only when it has not already been defined (#149)
* Include config.h only when it has not already been defined
* Rename config.h to UriConfig.h
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/UriMemory.c | 2 | ||||
-rw-r--r-- | test/VersionSuite.cpp | 2 |
4 files changed, 7 insertions, 7 deletions
@@ -1,5 +1,5 @@ /.idea/ -/config.h +/UriConfig.h /build/ /cmake-build-debug/ /CMakeCache.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b80f71..ed01577 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,11 +110,11 @@ if(URIPARSER_COMPILER_SUPPORTS_VISIBILITY) endif() # -# config.h +# UriConfig.h # check_symbol_exists(wprintf wchar.h HAVE_WPRINTF) check_function_exists(reallocarray HAVE_REALLOCARRAY) # no luck with CheckSymbolExists -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/UriConfig.h.in config.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/UriConfig.h.in UriConfig.h) # # C library @@ -193,7 +193,7 @@ target_include_directories(uriparser $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> PRIVATE - ${CMAKE_CURRENT_BINARY_DIR} # for config.h + ${CMAKE_CURRENT_BINARY_DIR} # for UriConfig.h ) uriparser_install( @@ -288,7 +288,7 @@ if(URIPARSER_BUILD_TESTS) target_include_directories(testrunner PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_BINARY_DIR} # for config.h + ${CMAKE_CURRENT_BINARY_DIR} # for UriConfig.h ) target_link_libraries(testrunner PUBLIC diff --git a/src/UriMemory.c b/src/UriMemory.c index e0caf9a..916d7ce 100644 --- a/src/UriMemory.c +++ b/src/UriMemory.c @@ -42,7 +42,7 @@ * Holds memory manager implementation. */ -#include <config.h> /* for HAVE_REALLOCARRAY */ +#include "UriConfig.h" /* for HAVE_REALLOCARRAY */ #ifdef HAVE_REALLOCARRAY # ifndef _GNU_SOURCE diff --git a/test/VersionSuite.cpp b/test/VersionSuite.cpp index a46f0d5..01f0284 100644 --- a/test/VersionSuite.cpp +++ b/test/VersionSuite.cpp @@ -23,7 +23,7 @@ #include <cstdio> -#include <config.h> // for PACKAGE_VERSION +#include "UriConfig.h" // for PACKAGE_VERSION #include <uriparser/UriBase.h> |