tests: Fixes for MSVC

* src/test_main.c: Fix undeclared off_t type with MSVC
* tests/misc_test.c: Fix undefined S_ISCHR & S_ISBLK with MSVC
* tests/stdin_test.c: Fix undefined STDIN_FILENO with MSVC
* tests/win32_ordinal_test.c: Fix undeclared getcwd() with MSVC
* Fix missing unistd.h under Win32

Related: https://github.com/erikd/libsndfile/issues/154
This commit is contained in:
evpobr 2017-04-12 12:11:06 +05:00 committed by Erik de Castro Lopo
parent 261a0dd489
commit 58737ceb48
50 changed files with 118 additions and 3 deletions

View File

@ -39,6 +39,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -20,7 +20,11 @@
#include <stdio.h>
#include <stdlib.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>

View File

@ -19,7 +19,11 @@
#include "sfconfig.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <math.h>

View File

@ -24,6 +24,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <string.h>

View File

@ -28,6 +28,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include "sndfile.h"

View File

@ -28,6 +28,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include "sndfile.h"

View File

@ -28,6 +28,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include "sndfile.h"

View File

@ -28,6 +28,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include "sndfile.h"

View File

@ -62,6 +62,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include "sndfile.h"

View File

@ -23,6 +23,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <string.h>

View File

@ -27,6 +27,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include "common.h"

View File

@ -23,6 +23,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <string.h>

View File

@ -20,6 +20,9 @@
#include <stdio.h>
#include <stdlib.h>
#if defined (HAVE_SYS_TYPES) && (HAVE_SYS_TYPES == 1)
#include <sys/types.h>
#endif
#include <string.h>
#include <stdarg.h>
#include <errno.h>

View File

@ -21,7 +21,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <math.h>
#include <inttypes.h>

View File

@ -24,6 +24,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -27,6 +27,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <math.h>

View File

@ -25,6 +25,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -27,6 +27,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <math.h>

View File

@ -21,7 +21,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <math.h>

View File

@ -16,6 +16,8 @@
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "sfconfig.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>

View File

@ -16,6 +16,8 @@
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "sfconfig.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

View File

@ -17,10 +17,14 @@
*/
#include "sfconfig.h"
#include <stdio.h>
#include <stdlib.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <string.h>
#include <math.h>

View File

@ -25,6 +25,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -24,6 +24,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#if OS_IS_WIN32

View File

@ -25,6 +25,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -16,10 +16,16 @@
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "sfconfig.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <math.h>
#include <inttypes.h>

View File

@ -27,6 +27,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -24,6 +24,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include "sndfile.h"

View File

@ -16,6 +16,8 @@
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "sfconfig.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -26,6 +26,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -24,6 +24,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -24,6 +24,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#if HAVE_LOCALE_H

View File

@ -26,6 +26,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -27,6 +27,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -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

View File

@ -21,7 +21,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <math.h>

View File

@ -27,6 +27,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -26,6 +26,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -26,6 +26,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -27,6 +27,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -22,6 +22,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -16,6 +16,8 @@
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "sfconfig.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View File

@ -25,6 +25,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>
@ -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) ;

View File

@ -29,6 +29,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sys/types.h>

View File

@ -25,6 +25,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -26,6 +26,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -24,6 +24,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>

View File

@ -31,6 +31,8 @@
extern "C" {
#endif /* __cplusplus */
#include "sfconfig.h"
#include <stdint.h>
#include <stdarg.h>

View File

@ -31,6 +31,7 @@
#include <string.h>
#include <fcntl.h>
#include <dirent.h>
#include <sys/types.h>
#include "utils.h"

View File

@ -28,6 +28,8 @@
#if HAVE_UNISTD_H
#include <unistd.h>
#else
#include "sf_unistd.h"
#endif
#include <sndfile.h>