Skip to content

Commit de65a12

Browse files
authored
Merge pull request #84 from sezero/strings1
check presence of strings.h, and include where necessary if available.
2 parents 8d0b03a + 1a41b26 commit de65a12

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,16 @@ if (WIN32)
5454
add_definitions(-DNOMINMAX)
5555
endif()
5656

57-
check_include_file("stdint.h" HAVE_STDINT)
58-
if (HAVE_STDINT)
57+
check_include_file("stdint.h" HAVE_STDINT_H)
58+
if (HAVE_STDINT_H)
5959
add_definitions(-DHAVE_STDINT_H)
6060
endif()
6161

62+
check_include_file("strings.h" HAVE_STRINGS_H)
63+
if (HAVE_STRINGS_H)
64+
add_definitions(-DHAVE_STRINGS_H)
65+
endif()
66+
6267
check_function_exists("sinf" HAVE_SINF)
6368
if(HAVE_SINF)
6469
add_definitions(-DHAVE_SINF)

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ AC_C_BIGENDIAN
1919

2020
LT_INIT([win32-dll disable-static])
2121

22-
AC_CHECK_HEADERS([inttypes.h stdint.h malloc.h])
22+
AC_CHECK_HEADERS([inttypes.h stdint.h malloc.h strings.h])
2323

2424
CXXFLAGS="$CXXFLAGS -fno-exceptions -Wall -ffast-math -fno-common -D_REENTRANT"
2525

src/load_abc.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
#include <stdlib.h>
2929
#include <time.h>
3030
#include <string.h>
31+
#ifdef HAVE_STRINGS_H
32+
#include <strings.h>
33+
#endif
3134
#include <math.h>
3235
#include <ctype.h>
3336
#ifndef _WIN32

src/load_pat.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#include <stdlib.h>
3232
#include <time.h>
3333
#include <string.h>
34+
#ifdef HAVE_STRINGS_H
35+
#include <strings.h>
36+
#endif
3437
#include <math.h>
3538
#include <ctype.h>
3639
#include <limits.h> // for PATH_MAX

0 commit comments

Comments
 (0)