Skip to content

Commit f766edc

Browse files
committed
Allow build on Solaris 11.4
1 parent c2ddd01 commit f766edc

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ if(WIN32)
7676
set(CMAKE_C_FLAGS "/Zc:preprocessor /W3 /wd4711 /w14013 /utf-8 ${CMAKE_C_FLAGS}")
7777
else()
7878
# global C flags
79-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic -std=c11")
79+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic")
8080
endif()
8181

8282
include_directories(${PROJECT_BINARY_DIR}/libyang ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/src/plugins_exts)

CMakeModules/FindPCRE2.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ else()
1515
pcre2.h
1616
PATHS
1717
/usr/include
18+
/usr/include/pcre
1819
/usr/local/include
1920
/opt/local/include
2021
/sw/include

src/tree_schema.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,7 +2370,11 @@ lys_search_localfile_file_type(const struct dirent *file, const char *wd, struct
23702370

23712371
*skip = 0;
23722372

2373+
#ifdef __sun__
2374+
if (1) {
2375+
#else
23732376
if ((file->d_type == DT_UNKNOWN) || (file->d_type == DT_LNK)) {
2377+
#endif
23742378
/* FS does not support this field or its a symbolic link, need to call stat */
23752379
if (asprintf(&str, "%s/%s", wd, file->d_name) == -1) {
23762380
LOGMEM(NULL);
@@ -2387,13 +2391,17 @@ lys_search_localfile_file_type(const struct dirent *file, const char *wd, struct
23872391
/* stat - file */
23882392
is_reg = 1;
23892393
}
2394+
#ifdef __sun__
2395+
}
2396+
#else
23902397
} else if (file->d_type == DT_DIR) {
23912398
/* dirent - dir */
23922399
is_dir = 1;
23932400
} else if (file->d_type == DT_REG) {
23942401
/* dirent - file */
23952402
is_reg = 1;
23962403
}
2404+
#endif
23972405

23982406
if (is_dir && (dirs->count || !implicit_cwd)) {
23992407
/* we have another subdirectory in searchpath to explore,

0 commit comments

Comments
 (0)