shithub: sox

Download patch

ref: 1135e7d9c07c0835f1e28916d929facbed97f4f6
parent: 7e33bc7700b12ac5f1fac2ab0dc92ac281d7fdcc
author: idigdoug <idigdoug>
date: Wed Dec 2 06:09:41 EST 2009

Output better diagnostic messages when searching for shared libraries. Define aliases for Posix function names so they can be recognized by VC without warning. Allow use of 64-bit file lengths with the MSVC CRT.

--- a/src/util.c
+++ b/src/util.c
@@ -177,10 +177,12 @@
 
     for (libname = library_names; *libname; libname++)
     {
+      lsx_debug("Attempting to open %s (%s).", library_description, *libname);
       dl = lt_dlopenext(*libname);
       if (dl)
       {
         size_t i;
+        lsx_debug("Opened %s (%s).", library_description, *libname);
         for (i = 0; func_infos[i].name; i++)
         {
           union {lsx_dlptr fn; lt_ptr ptr;} func;
@@ -192,6 +194,7 @@
             dl = NULL;
             failed_libname = *libname;
             failed_funcname = func_infos[i].name;
+            lsx_debug("Cannot use %s (%s) - missing function \"%s\".", library_description, failed_libname, failed_funcname);
             break;
           }
         }
--- a/src/util.h
+++ b/src/util.h
@@ -32,6 +32,7 @@
 #endif
 
 #ifdef _MSC_VER
+
 #define __STDC__ 1
 #define O_BINARY _O_BINARY
 #define O_CREAT _O_CREAT
@@ -41,19 +42,35 @@
 #define S_IFREG _S_IFREG
 #define S_IREAD _S_IREAD
 #define S_IWRITE _S_IWRITE
+#define close _close
+#define dup _dup
 #define fdopen _fdopen
+#define fileno _fileno
 #define fstat _fstat
 #define ftime _ftime
 #define inline __inline
 #define isatty _isatty
+#define kbhit _kbhit
 #define mktemp _mktemp
 #define off_t _off_t
 #define open _open
+#define pclose _pclose
 #define popen _popen
+#define setmode _setmode
+#define snprintf _snprintf
 #define stat _stat
 #define strdup _strdup
 #define timeb _timeb
 #define unlink _unlink
+
+#if defined(HAVE_FSEEKI64) && !defined(HAVE_FSEEKO)
+#undef off_t
+#define fseeko _fseeki64
+#define ftello _ftelli64
+#define off_t __int64
+#define HAVE_FSEEKO 1
+#endif
+
 #endif
 
 #if defined(DOS) || defined(WIN32) || defined(__NT__) || defined(__DJGPP__) || defined(__OS2__)