Skip to content

Commit

Permalink
Merge pull request #62 from rouault/fix_61
Browse files Browse the repository at this point in the history
geo_config.h: prefix HAVE_xxx and restrict it to GEOTIFF_HAVE_STRINGS_H (fixes #61)
  • Loading branch information
rouault authored Dec 17, 2021
2 parents 70c8b09 + b8c1d2a commit a2b74d7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 32 deletions.
5 changes: 1 addition & 4 deletions libgeotiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ ENDIF()

# Check required standard headers
INCLUDE(CheckIncludeFiles)
CHECK_INCLUDE_FILES(stdio.h HAVE_STDIO_H)
CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILES(string.h HAVE_STRING_H)
CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H)
CHECK_INCLUDE_FILES(strings.h GEOTIFF_HAVE_STRINGS_H)

###############################################################################
# User-defined build settings
Expand Down
8 changes: 1 addition & 7 deletions libgeotiff/cmake/geo_config.h.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
#ifndef GEO_CONFIG_H
#define GEO_CONFIG_H

/* Define if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H

/* Define if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H

/* Define if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H
#cmakedefine GEOTIFF_HAVE_STRINGS_H 1

#cmakedefine GEO_NORMALIZE_DISABLE_TOWGS84

Expand Down
6 changes: 5 additions & 1 deletion libgeotiff/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ dnl #########################################################################
dnl Checks for header files.
dnl #########################################################################

AC_CHECK_HEADERS([string.h],[HAVE_STRING_H=1], [AC_MSG_ERROR([cannot find string.h, bailing out])])
dnl AC_CHECK_HEADERS([string.h],[HAVE_STRING_H=1], [AC_MSG_ERROR([cannot find string.h, bailing out])])
AC_CHECK_HEADERS([strings.h],[GEOTIFF_HAVE_STRINGS_H=1])
AC_DEFINE_UNQUOTED(GEOTIFF_HAVE_STRINGS_H, 1,
[Define if you have the <strings.h> header file.])

AC_CHECK_HEADERS([stdio.h],, [AC_MSG_ERROR([cannot find stdio.h, bailing out])])
AC_CHECK_HEADERS([stdlib.h],, [AC_MSG_ERROR([cannot find stdlib.h, bailing out])])

Expand Down
10 changes: 3 additions & 7 deletions libgeotiff/cpl_serv.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@

#include <math.h>

#ifdef HAVE_STRING_H
# include <string.h>
#endif
#if defined(HAVE_STRINGS_H) && !defined(_WIN32)
#include <string.h>
#if defined(GEOTIFF_HAVE_STRINGS_H) && !defined(_WIN32)
# include <strings.h>
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include <stdlib.h>

/**********************************************************************
* Do we want to build as a DLL on windows?
Expand Down
14 changes: 1 addition & 13 deletions libgeotiff/geo_config.h.in
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
#ifndef GEO_CONFIG_H
#define GEO_CONFIG_H

/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS

/* Define if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H

/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H

/* Define if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H

#undef HAVE_LIBPROJ
#undef HAVE_PROJECTS_H
#undef GEOTIFF_HAVE_STRINGS_H

#undef GEO_NORMALIZE_DISABLE_TOWGS84

Expand Down

0 comments on commit a2b74d7

Please sign in to comment.