ref: 1f952517947a77f08fc0c983869de48051ec33ca
parent: fd5fd8eedefbf7722c684c6e5c2689024cf7dfe6
author: robs <robs>
date: Tue Jul 15 03:08:59 EDT 2008
prefer sys/types.h to unistd.h
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,6 +46,7 @@
check_include_files("strings.h" HAVE_STRINGS_H)
check_include_files("sys/time.h" HAVE_SYS_TIME_H)
check_include_files("sys/timeb.h" HAVE_SYS_TIMEB_H)
+check_include_files("sys/types.h" HAVE_SYS_TYPES_H)
check_include_files("unistd.h" HAVE_UNISTD_H)
check_function_exists("fseeko" HAVE_FSEEKO)
--- a/configure.ac
+++ b/configure.ac
@@ -102,7 +102,7 @@
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h unistd.h byteswap.h sys/time.h sys/timeb.h)
+AC_CHECK_HEADERS(fcntl.h unistd.h byteswap.h sys/time.h sys/timeb.h sys/types.h)
dnl Checks for library functions.
AC_CHECK_FUNCS(strcasecmp strdup popen vsnprintf gettimeofday)
--- a/src/8svx.c
+++ b/src/8svx.c
@@ -7,10 +7,6 @@
#include <stdlib.h>
#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h> /* For SEEK_* defines if not found in stdio */
-#endif
-
/* Private data used by writer */
typedef struct{
uint32_t nsamples;
--- a/src/aiff.c
+++ b/src/aiff.c
@@ -23,9 +23,6 @@
#include <stdio.h>
#include <errno.h>
#include <limits.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h> /* For SEEK_* defines if not found in stdio */
-#endif
/* forward declarations */
static double read_ieee_extended(sox_format_t *);
--- a/src/oss.c
+++ b/src/oss.c
@@ -26,7 +26,6 @@
#include "sox_i.h"
-#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
--- a/src/raw.c
+++ b/src/raw.c
@@ -10,10 +10,6 @@
#include "sox_i.h"
#include "g711.h"
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-
#define SOX_ULAW_BYTE_TO_SAMPLE(d,clips) SOX_SIGNED_16BIT_TO_SAMPLE(sox_ulaw2linear16(d),clips)
#define SOX_ALAW_BYTE_TO_SAMPLE(d,clips) SOX_SIGNED_16BIT_TO_SAMPLE(sox_alaw2linear16(d),clips)
#define SOX_SAMPLE_TO_ULAW_BYTE(d,c) sox_14linear2ulaw(SOX_SAMPLE_TO_SIGNED_16BIT(d,c) >> 2)
--- a/src/sox_i.h
+++ b/src/sox_i.h
@@ -22,8 +22,8 @@
typedef enum {SOX_WAVE_SINE, SOX_WAVE_TRIANGLE} lsx_wave_t;
extern enum_item const lsx_wave_enum[];
-#ifdef HAVE_UNISTD_H
-#include <unistd.h> /* For off_t not found in stdio.h */
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h> /* For off_t not found in stdio.h */
#endif
/* Define fseeko and ftello for platforms lacking them */
--- a/src/soxconfig.h.cmake
+++ b/src/soxconfig.h.cmake
@@ -33,6 +33,7 @@
#cmakedefine HAVE_SYS_SOUNDCARD_H 1
#cmakedefine HAVE_SYS_TIMEB_H 1
#cmakedefine HAVE_SYS_TIME_H 1
+#cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_UNISTD_H 1
#cmakedefine HAVE_VSNPRINTF 1
#cmakedefine HAVE_WAVPACK 1
--- a/src/sunaudio.c
+++ b/src/sunaudio.c
@@ -30,7 +30,6 @@
#if !defined(__NetBSD__) && !defined(__OpenBSD__)
#include <stropts.h>
#endif
-#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
--- a/src/wav.c
+++ b/src/wav.c
@@ -16,10 +16,6 @@
#include <stdlib.h>
#include <stdio.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h> /* For SEEK_* defines if not found in stdio */
-#endif
-
#include "ima_rw.h"
#include "adpcm.h"
#ifdef EXTERNAL_GSM