diff --git a/programs/sndfile-play.c b/programs/sndfile-play.c index 1fc96fa5..70b08623 100644 --- a/programs/sndfile-play.c +++ b/programs/sndfile-play.c @@ -39,6 +39,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/regtest/database.c b/regtest/database.c index f800a2c8..89362caf 100644 --- a/regtest/database.c +++ b/regtest/database.c @@ -20,7 +20,11 @@ #include #include +#if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" +#endif #include #include #include diff --git a/src/G72x/g72x_test.c b/src/G72x/g72x_test.c index c580c916..e8a97677 100644 --- a/src/G72x/g72x_test.c +++ b/src/G72x/g72x_test.c @@ -19,7 +19,11 @@ #include "sfconfig.h" #include +#if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" +#endif #include #include #include diff --git a/src/audio_detect.c b/src/audio_detect.c index 9cac83bc..b2671e8d 100644 --- a/src/audio_detect.c +++ b/src/audio_detect.c @@ -24,6 +24,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/src/ogg.c b/src/ogg.c index 0856f779..1c58508d 100644 --- a/src/ogg.c +++ b/src/ogg.c @@ -28,6 +28,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include "sndfile.h" diff --git a/src/ogg_opus.c b/src/ogg_opus.c index f5769e29..4a0ca1fd 100644 --- a/src/ogg_opus.c +++ b/src/ogg_opus.c @@ -28,6 +28,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include "sndfile.h" diff --git a/src/ogg_pcm.c b/src/ogg_pcm.c index f3cd94c6..d57d0c7a 100644 --- a/src/ogg_pcm.c +++ b/src/ogg_pcm.c @@ -28,6 +28,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include "sndfile.h" diff --git a/src/ogg_speex.c b/src/ogg_speex.c index b95d4dba..45b4d044 100644 --- a/src/ogg_speex.c +++ b/src/ogg_speex.c @@ -28,6 +28,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include "sndfile.h" diff --git a/src/ogg_vorbis.c b/src/ogg_vorbis.c index 78acd38b..1e733379 100644 --- a/src/ogg_vorbis.c +++ b/src/ogg_vorbis.c @@ -62,6 +62,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include "sndfile.h" diff --git a/src/test_audio_detect.c b/src/test_audio_detect.c index 9706249e..20926df0 100644 --- a/src/test_audio_detect.c +++ b/src/test_audio_detect.c @@ -23,6 +23,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/src/test_endswap.tpl b/src/test_endswap.tpl index 9f5a1cc9..1ce1358a 100644 --- a/src/test_endswap.tpl +++ b/src/test_endswap.tpl @@ -27,6 +27,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include "common.h" diff --git a/src/test_file_io.c b/src/test_file_io.c index 08fccebd..96f6add6 100644 --- a/src/test_file_io.c +++ b/src/test_file_io.c @@ -23,6 +23,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/src/test_main.c b/src/test_main.c index 1f2437d6..fc8206a2 100644 --- a/src/test_main.c +++ b/src/test_main.c @@ -20,6 +20,9 @@ #include #include +#if defined (HAVE_SYS_TYPES) && (HAVE_SYS_TYPES == 1) +#include +#endif #include #include #include diff --git a/tests/aiff_rw_test.c b/tests/aiff_rw_test.c index 2f8b6b5c..54eec4ba 100644 --- a/tests/aiff_rw_test.c +++ b/tests/aiff_rw_test.c @@ -21,7 +21,11 @@ #include #include #include +#if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" +#endif #include #include diff --git a/tests/alaw_test.c b/tests/alaw_test.c index 6d71ffed..b928083c 100644 --- a/tests/alaw_test.c +++ b/tests/alaw_test.c @@ -24,6 +24,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/channel_test.c b/tests/channel_test.c index 6fdb35da..a69cd32d 100644 --- a/tests/channel_test.c +++ b/tests/channel_test.c @@ -27,6 +27,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/chunk_test.c b/tests/chunk_test.c index f1bc0746..ed340643 100644 --- a/tests/chunk_test.c +++ b/tests/chunk_test.c @@ -25,6 +25,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/command_test.c b/tests/command_test.c index 941e76b3..10ddd5c9 100644 --- a/tests/command_test.c +++ b/tests/command_test.c @@ -27,6 +27,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/compression_size_test.c b/tests/compression_size_test.c index 85dbd351..aee17f28 100644 --- a/tests/compression_size_test.c +++ b/tests/compression_size_test.c @@ -21,7 +21,11 @@ #include #include #include +#if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" +#endif #include diff --git a/tests/cpp_test.cc b/tests/cpp_test.cc index 364ec86e..6e39da6d 100644 --- a/tests/cpp_test.cc +++ b/tests/cpp_test.cc @@ -16,6 +16,8 @@ ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "sfconfig.h" + #include #include #include diff --git a/tests/dft_cmp.c b/tests/dft_cmp.c index b94b6a2c..03bd4646 100644 --- a/tests/dft_cmp.c +++ b/tests/dft_cmp.c @@ -16,6 +16,8 @@ ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "sfconfig.h" + #include #include #include diff --git a/tests/dither_test.c b/tests/dither_test.c index e9eef7c1..c0928440 100644 --- a/tests/dither_test.c +++ b/tests/dither_test.c @@ -17,10 +17,14 @@ */ - +#include "sfconfig.h" #include #include +#if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" +#endif #include #include diff --git a/tests/dwvw_test.c b/tests/dwvw_test.c index 57bdfac9..b2cae067 100644 --- a/tests/dwvw_test.c +++ b/tests/dwvw_test.c @@ -25,6 +25,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/error_test.c b/tests/error_test.c index 1cadc68d..da670dcd 100644 --- a/tests/error_test.c +++ b/tests/error_test.c @@ -24,6 +24,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #if OS_IS_WIN32 diff --git a/tests/external_libs_test.c b/tests/external_libs_test.c index f671055b..d41075df 100644 --- a/tests/external_libs_test.c +++ b/tests/external_libs_test.c @@ -25,6 +25,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/fix_this.c b/tests/fix_this.c index 8ec06c6b..5c697ea8 100644 --- a/tests/fix_this.c +++ b/tests/fix_this.c @@ -16,10 +16,16 @@ ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "sfconfig.h" + #include #include #include +#if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" +#endif #include #include diff --git a/tests/floating_point_test.tpl b/tests/floating_point_test.tpl index fab0d9ba..f026f4cd 100644 --- a/tests/floating_point_test.tpl +++ b/tests/floating_point_test.tpl @@ -27,6 +27,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/format_check_test.c b/tests/format_check_test.c index a371c71f..b9cc02e2 100644 --- a/tests/format_check_test.c +++ b/tests/format_check_test.c @@ -24,6 +24,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include "sndfile.h" diff --git a/tests/generate.c b/tests/generate.c index 653018b0..87efbb44 100644 --- a/tests/generate.c +++ b/tests/generate.c @@ -16,6 +16,8 @@ ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "sfconfig.h" + #include #include #include diff --git a/tests/headerless_test.c b/tests/headerless_test.c index 6d3e2f25..059fa683 100644 --- a/tests/headerless_test.c +++ b/tests/headerless_test.c @@ -26,6 +26,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/largefile_test.c b/tests/largefile_test.c index 328a589a..4c97c90b 100644 --- a/tests/largefile_test.c +++ b/tests/largefile_test.c @@ -24,6 +24,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/locale_test.c b/tests/locale_test.c index b67d549c..b2653016 100644 --- a/tests/locale_test.c +++ b/tests/locale_test.c @@ -24,6 +24,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #if HAVE_LOCALE_H diff --git a/tests/long_read_write_test.c b/tests/long_read_write_test.c index c611f56f..48624687 100644 --- a/tests/long_read_write_test.c +++ b/tests/long_read_write_test.c @@ -26,6 +26,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/lossy_comp_test.c b/tests/lossy_comp_test.c index 0d5a8f76..62af8de7 100644 --- a/tests/lossy_comp_test.c +++ b/tests/lossy_comp_test.c @@ -27,6 +27,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/misc_test.c b/tests/misc_test.c index 90a9d012..b4e0f423 100644 --- a/tests/misc_test.c +++ b/tests/misc_test.c @@ -265,7 +265,7 @@ filesystem_full_test (int format) #if (defined (WIN32) || defined (_WIN32)) /* Can't run this test on Win32 so return. */ return ; -#endif +#else /* Make sure errno is zero before doing anything else. */ errno = 0 ; @@ -300,6 +300,7 @@ filesystem_full_test (int format) } ; puts ("ok") ; +#endif } /* filesystem_full_test */ static void diff --git a/tests/ogg_test.c b/tests/ogg_test.c index 78d24b3d..ba3d8992 100644 --- a/tests/ogg_test.c +++ b/tests/ogg_test.c @@ -21,7 +21,11 @@ #include #include #include +#if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" +#endif #include diff --git a/tests/pcm_test.tpl b/tests/pcm_test.tpl index 96aea930..4658f1b5 100644 --- a/tests/pcm_test.tpl +++ b/tests/pcm_test.tpl @@ -27,6 +27,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/peak_chunk_test.c b/tests/peak_chunk_test.c index 765571f9..3e1aa3d3 100644 --- a/tests/peak_chunk_test.c +++ b/tests/peak_chunk_test.c @@ -26,6 +26,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/raw_test.c b/tests/raw_test.c index 6728e368..be0f94dc 100644 --- a/tests/raw_test.c +++ b/tests/raw_test.c @@ -26,6 +26,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/scale_clip_test.tpl b/tests/scale_clip_test.tpl index 39ddf57c..ad59ce16 100644 --- a/tests/scale_clip_test.tpl +++ b/tests/scale_clip_test.tpl @@ -27,6 +27,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/sftest.c b/tests/sftest.c index 78a9f7fa..497265c9 100644 --- a/tests/sftest.c +++ b/tests/sftest.c @@ -22,6 +22,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/sfversion.c b/tests/sfversion.c index b432e191..6caa77ae 100644 --- a/tests/sfversion.c +++ b/tests/sfversion.c @@ -16,6 +16,8 @@ ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "sfconfig.h" + #include #include #include diff --git a/tests/stdin_test.c b/tests/stdin_test.c index a893915c..651614ae 100644 --- a/tests/stdin_test.c +++ b/tests/stdin_test.c @@ -25,6 +25,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include @@ -149,7 +151,7 @@ stdin_test (int typemajor, int count) else memset (&sfinfo, 0, sizeof (sfinfo)) ; - if ((file = sf_open_fd (STDIN_FILENO, SFM_READ, &sfinfo, SF_TRUE)) == NULL) + if ((file = sf_open_fd (fileno (stdin), SFM_READ, &sfinfo, SF_TRUE)) == NULL) { fprintf (stderr, "sf_open_fd failed with error : ") ; puts (sf_strerror (NULL)) ; dump_log_buffer (NULL) ; diff --git a/tests/stdio_test.c b/tests/stdio_test.c index 80a696cf..42e3f286 100644 --- a/tests/stdio_test.c +++ b/tests/stdio_test.c @@ -29,6 +29,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/stdout_test.c b/tests/stdout_test.c index 94046986..a71ed643 100644 --- a/tests/stdout_test.c +++ b/tests/stdout_test.c @@ -25,6 +25,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/string_test.c b/tests/string_test.c index 572726f7..96b0c547 100644 --- a/tests/string_test.c +++ b/tests/string_test.c @@ -26,6 +26,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/ulaw_test.c b/tests/ulaw_test.c index fc0d497a..9e0eba9b 100644 --- a/tests/ulaw_test.c +++ b/tests/ulaw_test.c @@ -24,6 +24,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include diff --git a/tests/utils.tpl b/tests/utils.tpl index 096b758d..310a69a4 100644 --- a/tests/utils.tpl +++ b/tests/utils.tpl @@ -31,6 +31,8 @@ extern "C" { #endif /* __cplusplus */ +#include "sfconfig.h" + #include #include diff --git a/tests/win32_ordinal_test.c b/tests/win32_ordinal_test.c index 49f78600..46f4d8af 100644 --- a/tests/win32_ordinal_test.c +++ b/tests/win32_ordinal_test.c @@ -31,6 +31,7 @@ #include #include +#include #include #include "utils.h" diff --git a/tests/write_read_test.tpl b/tests/write_read_test.tpl index b908db0f..af87e12a 100644 --- a/tests/write_read_test.tpl +++ b/tests/write_read_test.tpl @@ -28,6 +28,8 @@ #if HAVE_UNISTD_H #include +#else +#include "sf_unistd.h" #endif #include