diff --git a/CMakeLists.txt b/CMakeLists.txt index bc97de4ee..082dcdb26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -329,8 +329,8 @@ if ("${BUILD_TYPE_UPPER}" STREQUAL "DEBUG") endif() # check regex compatibility -check_include_file("regex.h" HAVE_REGEX_H) -if(HAVE_REGEX_H) +check_include_file("regex.h" LY_HAVE_REGEX_H) +if(LY_HAVE_REGEX_H) check_symbol_exists(REG_STARTEND "regex.h" HAVE_REG_STARTEND) endif() diff --git a/src/ly_common.c b/src/ly_common.c index c1ad0a588..91a6c4e7a 100644 --- a/src/ly_common.c +++ b/src/ly_common.c @@ -16,7 +16,7 @@ #include "ly_common.h" -#ifdef HAVE_REGEX_H +#ifdef LY_HAVE_REGEX_H # include #endif @@ -667,7 +667,7 @@ ly_ctx_shared_data_pattern_del(const struct ly_ctx *ctx, const char *pattern, ly static LY_ERR ly_pat_compile_posix(const char *pattern, void **pat_comp, struct ly_err_item **err) { -#ifdef HAVE_REGEX_H +#ifdef LY_HAVE_REGEX_H LY_ERR rc = LY_SUCCESS; int err_code; size_t err_len; @@ -1035,7 +1035,7 @@ ly_pat_compile(const char *pattern, ly_bool format, void **pat_comp, struct ly_e static LY_ERR ly_pat_match_posix(const void *pat_comp, const char *pattern, const char *str, size_t str_len, struct ly_err_item **err) { -#ifdef HAVE_REGEX_H +#ifdef LY_HAVE_REGEX_H LY_ERR rc = LY_SUCCESS; int err_code; regex_t *preg_p = (void *)pat_comp; @@ -1177,7 +1177,7 @@ ly_pat_free(void *pat_comp, ly_bool format) } if (format) { -#ifdef HAVE_REGEX_H +#ifdef LY_HAVE_REGEX_H regfree(pat_comp); free(pat_comp); #endif diff --git a/src/ly_config.h.in b/src/ly_config.h.in index 5e27103c7..7cce68004 100644 --- a/src/ly_config.h.in +++ b/src/ly_config.h.in @@ -85,7 +85,7 @@ #endif /** existence of regex.h */ -#cmakedefine HAVE_REGEX_H +#cmakedefine LY_HAVE_REGEX_H /** regex.h BSD flag */ #cmakedefine HAVE_REG_STARTEND diff --git a/tests/utests/CMakeLists.txt b/tests/utests/CMakeLists.txt index a82208dca..37ae7296c 100644 --- a/tests/utests/CMakeLists.txt +++ b/tests/utests/CMakeLists.txt @@ -77,6 +77,6 @@ ly_add_utest(NAME nacm SOURCES extensions/test_nacm.c) ly_add_utest(NAME yangdata SOURCES extensions/test_yangdata.c) ly_add_utest(NAME schema_mount SOURCES extensions/test_schema_mount.c) ly_add_utest(NAME structure SOURCES extensions/test_structure.c) -if(HAVE_REGEX_H) +if(LY_HAVE_REGEX_H) ly_add_utest(NAME openconfig SOURCES extensions/test_openconfig.c) endif()