Make the cwrapper build using MSVC and older MinGW.

        * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src): Add
        support for Microsoft Visual C. Also, older MinGW versions
        seem to need stdint.h to find intptr_t.
Make the cwrapper build using MSVC.

        * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src): Add
        support for Microsoft Visual C. Also, older MinGW versions
        seem to need stdint.h to find intptr_t.

Index: libtool/libltdl/config/ltmain.m4sh
===================================================================
--- libtool.orig/libltdl/config/ltmain.m4sh
+++ libtool/libltdl/config/ltmain.m4sh
@@ -2521,7 +2521,13 @@ EOF
            cat <<"EOF"
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+#endif
 #include <malloc.h>
 #include <stdarg.h>
 #include <assert.h>
@@ -2545,6 +2551,14 @@ EOF
 # define S_IXGRP 0
 #endif
 
+#ifdef _MSC_VER
+# define S_IXUSR _S_IEXEC
+# define _stat stat
+# ifndef _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#endif
+
 #ifndef DIR_SEPARATOR
 # define DIR_SEPARATOR '/'
 # define PATH_SEPARATOR ':'

Reply via email to