Skip to content

Commit e07d0db

Browse files
committed
Check for _str[n]icmp for Windows
1 parent dc17ecf commit e07d0db

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

configure.ac

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ AC_SEARCH_LIBS([strlcpy], [bsd])
3737
AS_IF([test "x$ac_cv_search_strlcpy" = "x-lbsd"], [AC_CHECK_HEADERS([bsd/string.h])])
3838
AC_CHECK_FUNCS([strlcpy])
3939

40+
dnl Windows might not have str[n]casecmp
41+
AC_CHECK_FUNCS(strcasecmp)
42+
AC_CHECK_FUNCS(strncasecmp)
43+
AC_CHECK_FUNCS(_stricmp)
44+
AC_CHECK_FUNCS(_strnicmp)
45+
4046
# Need the math library
4147
AC_CHECK_LIB([m],[sin])
4248

palObs.c

+4
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ static void star__strellcpy( char * dest, const char * src, size_t size ) {
155155
#define star_strellcpy(dest, src, size) star__strellcpy(dest, src, size)
156156
#endif
157157

158+
#if HAVE__STRICMP || defined(_WIN32) || defined(_WIN64)
159+
#define strcasecmp _stricmp
160+
#endif
161+
158162
#include "pal.h"
159163
#include "palmac.h"
160164

palPreces.c

+8
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,19 @@
8383
*-
8484
*/
8585

86+
#if HAVE_CONFIG_H
87+
# include <config.h>
88+
#endif
89+
8690
#include "pal.h"
8791
#include "pal1sofa.h"
8892

8993
#include <string.h>
9094

95+
#if HAVE__STRNICMP || defined(_WIN32) || defined(_WIN64)
96+
# define strncasecmp _strnicmp
97+
#endif
98+
9199
void palPreces ( const char sys[3], double ep0, double ep1,
92100
double *ra, double *dc ) {
93101

0 commit comments

Comments
 (0)