Skip to content

Commit

Permalink
Removed checks for long-standard or long-obsolete headers
Browse files Browse the repository at this point in the history
Many of these header have been standardized since C89, others have been obsolete forever.

This started as fixing some -Wundef warnings, but then I thought I'd clean up more.
  • Loading branch information
seanm authored and vfonov committed Feb 24, 2025
1 parent 1413b02 commit 072cbea
Show file tree
Hide file tree
Showing 17 changed files with 1 addition and 64 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,24 +183,18 @@ ELSE(HAVE_CLOCK_GETTIME_RT)
ENDIF(HAVE_CLOCK_GETTIME_RT)

INCLUDE(CheckIncludeFiles)
CHECK_INCLUDE_FILES(float.h HAVE_FLOAT_H)
CHECK_INCLUDE_FILES(sys/dir.h HAVE_SYS_DIR_H)
CHECK_INCLUDE_FILES(sys/ndir.h HAVE_SYS_NDIR_H)
CHECK_INCLUDE_FILES(sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES(sys/wait.h HAVE_SYS_WAIT_H)
CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILES(time.h HAVE_TIME_H)
CHECK_INCLUDE_FILES(values.h HAVE_VALUES_H)
CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILES(dirent.h HAVE_DIRENT_H)
CHECK_INCLUDE_FILES(memory.h HAVE_MEMORY_H)
CHECK_INCLUDE_FILES(stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILES(fcntl.h HAVE_FCNTL_H)
CHECK_INCLUDE_FILES(dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILES(vfork.h HAVE_VFORK_H)
CHECK_INCLUDE_FILES(inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES(string.h HAVE_STRING_H)
CHECK_INCLUDE_FILES(strings.h HAVE_STRINGS_H)
CHECK_INCLUDE_FILES(pwd.h HAVE_PWD_H)
CHECK_INCLUDE_FILES(sys/select.h HAVE_SYS_SELECT_H)
Expand Down
6 changes: 0 additions & 6 deletions config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#cmakedefine HAVE_MKSTEMP 1
#cmakedefine HAVE_STRERROR 1
#cmakedefine HAVE_FLOAT_H 1

#cmakedefine HAVE_COPYSIGN 1
#cmakedefine HAVE_ROUND 1
Expand All @@ -35,36 +34,31 @@
#cmakedefine HAVE_INT16_T 1
#cmakedefine HAVE_INT32_T 1
#cmakedefine HAVE_INTTYPES_H 1
#cmakedefine HAVE_MEMORY_H 1
#cmakedefine HAVE_MKSTEMP 1
#cmakedefine HAVE_NDIR_H 1
#cmakedefine HAVE_POPEN 1
#cmakedefine HAVE_PWD_H 1
#cmakedefine HAVE_SELECT 1
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_STDLIB_H 1
#cmakedefine HAVE_STRDUP 1
#cmakedefine HAVE_SYSCONF 1
#cmakedefine HAVE_SYSTEM 1
#cmakedefine HAVE_SYS_DIR_H 1
#cmakedefine HAVE_SYS_NDIR_H 1
#cmakedefine HAVE_SYS_STAT_H 1
#cmakedefine HAVE_SYS_TIME_H 1
#cmakedefine HAVE_TIME_H 1
#cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_SYS_WAIT_H 1
#cmakedefine HAVE_SYS_SELECT_H 1
#cmakedefine HAVE_TEMPNAM 1
#cmakedefine HAVE_TMPNAM 1
#cmakedefine HAVE_UNISTD_H 1
#cmakedefine HAVE_VALUES_H 1
#cmakedefine HAVE_VFORK 1
#cmakedefine HAVE_VFORK_H 1
#cmakedefine HAVE_WORKING_FORK 1
#cmakedefine HAVE_WORKING_VFORK 1
#cmakedefine HAVE_ZLIB 1
#cmakedefine HAVE_STRINGS_H 1
#cmakedefine HAVE_STRING_H 1
#cmakedefine HAVE_SRAND48 1
#cmakedefine HAVE_DRAND48 1
#cmakedefine HAVE_SLEEP 1
Expand Down
4 changes: 0 additions & 4 deletions libcommon/ParseArgv.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@

#include <stdio.h>

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif

#ifdef HAVE_STRING_H
#include <string.h>
#endif

#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
Expand Down
5 changes: 0 additions & 5 deletions libcommon/minc_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
#include <stdio.h>
#include <ctype.h>

#ifdef HAVE_STRING_H
#include <string.h>
#endif

#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif


#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif

#include "minc_config.h"

Expand Down
2 changes: 0 additions & 2 deletions libcommon/time_stamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@
#include "config.h"
#endif /*HAVE_CONFIG_H*/

#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include <stdio.h>

/* MS Visual Studio 12 and below.
Expand Down
4 changes: 0 additions & 4 deletions libsrc/config.h.msvc-win32
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
#define _CONFIG_H_ 1

#define HAVE_FCNTL_H 1
#define HAVE_FLOAT_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_TEMPNAM 1
Expand Down
2 changes: 0 additions & 2 deletions libsrc2/dimension.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@

#include <math.h>

#ifdef HAVE_STRING_H
#include <string.h>
#endif /*HAVE_STRING_H*/

/**
Figure out whether a dimension is associated with a volume.
Expand Down
2 changes: 0 additions & 2 deletions testdir/icv.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

#include <minc.h>

#ifdef HAVE_STRING_H
#include <string.h>
#endif

#define TRUE 1
#define FALSE 0
Expand Down
2 changes: 0 additions & 2 deletions testdir/icv_dim.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

#include <minc.h>

#ifdef HAVE_STRING_H
#include <string.h>
#endif

#define TRUE 1
#define FALSE 0
Expand Down
2 changes: 0 additions & 2 deletions testdir/icv_dim1.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

#include <minc.h>

#ifdef HAVE_STRING_H
#include <string.h>
#endif

#define TRUE 1
#define FALSE 0
Expand Down
2 changes: 0 additions & 2 deletions testdir/icv_fillvalue.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
#include <unistd.h>
#endif

#ifdef HAVE_STRING_H
#include <string.h>
#endif

#define TRUE 1
#define FALSE 0
Expand Down
2 changes: 0 additions & 2 deletions testdir/icv_range.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
#include <unistd.h>
#endif

#ifdef HAVE_STRING_H
#include <string.h>
#endif

#define TRUE 1
#define FALSE 0
Expand Down
4 changes: 0 additions & 4 deletions testdir/icv_vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@
#include <unistd.h>
#endif

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif

#include <math.h>
#include <minc.h>

#ifdef HAVE_STRING_H
#include <string.h>
#endif

#ifndef TRUE
#define TRUE 1
Expand Down
2 changes: 0 additions & 2 deletions testdir/minc_types.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
#include <unistd.h>
#endif

#ifdef HAVE_STRING_H
#include <string.h>
#endif


static struct {
Expand Down
14 changes: 0 additions & 14 deletions volume_io/Include/volume_io/system_dependent.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,7 @@
express or implied warranty.
---------------------------------------------------------------------------- */

#if HAVE_FLOAT_H
#include <float.h>

#else

#if HAVE_VALUES_H
#include <values.h>

#ifndef DBL_MAX
#define DBL_MAX MAXDOUBLE
#endif /* DBL_MAX not defined */

#endif /* HAVE_VALUES_H */
#endif /* HAVE_FLOAT_H */

#include <stdlib.h>

#ifndef EXIT_FAILURE
Expand Down
4 changes: 1 addition & 3 deletions volume_io/Prog_utils/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
# include <sys/time.h>
#endif

#if HAVE_TIME_H
# include <time.h>
#endif
#include <time.h>

#if HAVE_UNISTD_H
#include <unistd.h>
Expand Down
2 changes: 0 additions & 2 deletions volume_io/Volumes/input_nrrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

#include <stdio.h>

#if HAVE_STRING_H
#include <string.h>
#endif

#if HAVE_STRINGS_H
#include <strings.h>
Expand Down

0 comments on commit 072cbea

Please sign in to comment.