Improved MingW compatibility.

This commit is contained in:
Gunnar Beutner 2012-05-28 10:41:21 +02:00
parent 6f6cc52e20
commit d130d6017f
4 changed files with 19 additions and 2 deletions

View File

@ -38,8 +38,6 @@ Application::Application(void)
if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0)
throw Win32Exception("WSAStartup failed", WSAGetLastError());
#else /* _WIN32 */
LTDL_SET_PRELOADED_SYMBOLS();
lt_dlinit();
#endif /* _WIN32 */

View File

@ -21,12 +21,19 @@
#define WIN32_H
#define WIN32_LEAN_AND_MEAN
#define _WIN32_WINNT 0x0502
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <imagehlp.h>
#include <shlwapi.h>
#ifdef __MINGW32__
# ifndef IPV6_V6ONLY
# define IPV6_V6ONLY 27
# endif /* IPV6_V6ONLY */
#endif /* __MINGW32__ */
typedef int socklen_t;
#define MAXPATHLEN MAX_PATH

View File

@ -37,7 +37,11 @@ AX_CXX_COMPILE_STDCXX_0X
AX_CXX_GCC_ABI_DEMANGLE
AX_PTHREAD
<<<<<<< Updated upstream
LT_INIT([dlopen disable-static])
=======
LT_INIT([dlopen shared disable-static win32-dll])
>>>>>>> Stashed changes
LT_CONFIG_LTDL_DIR([ltdl])
LTDL_INIT
@ -67,6 +71,8 @@ AC_CHECK_LIB(eay32, X509_NAME_oneline)
AC_CHECK_LIB(m, floor)
AC_CHECK_LIB(pthread, pthread_create)
AC_CHECK_LIB(socket, getsockname)
AC_CHECK_LIB(ws2_32, getsockname)
AC_CHECK_LIB(shlwapi, PathRemoveFileSpecA)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <openssl/ssl.h>]], [])],

View File

@ -19,6 +19,10 @@
#include <i2-icinga.h>
#ifndef _WIN32
# include <ltdl.h>
#endif /* _WIN32 */
using namespace icinga;
/**
@ -30,6 +34,8 @@ using namespace icinga;
*/
int main(int argc, char **argv)
{
LTDL_SET_PRELOADED_SYMBOLS();
IcingaApplication::Ptr instance = make_shared<IcingaApplication>();
return instance->Run(argc, argv);
}