Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
8 changes: 4 additions & 4 deletions src/ly_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "ly_common.h"

#ifdef HAVE_REGEX_H
#ifdef LY_HAVE_REGEX_H
# include <regex.h>
#endif

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ly_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/utests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Loading