Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geo_config.h: prefix HAVE_xxx and restrict it to GEOTIFF_HAVE_STRINGS_H (fixes #61) #62

Merged
merged 1 commit into from
Dec 17, 2021
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
5 changes: 1 addition & 4 deletions libgeotiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,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