From e469e4fc62163db69385a2cfadcb00dfb4ed1196 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Thu, 21 Aug 2014 14:27:51 -0500 Subject: [PATCH 1/5] Fix static init exceptions for MinGW*. --- Data/MySQL/include/Poco/Data/MySQL/Connector.h | 2 +- Data/ODBC/include/Poco/Data/ODBC/Connector.h | 2 +- Data/SQLite/include/Poco/Data/SQLite/Connector.h | 2 +- Net/include/Poco/Net/Net.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Data/MySQL/include/Poco/Data/MySQL/Connector.h b/Data/MySQL/include/Poco/Data/MySQL/Connector.h index 6ac80106a..be7a50cd6 100644 --- a/Data/MySQL/include/Poco/Data/MySQL/Connector.h +++ b/Data/MySQL/include/Poco/Data/MySQL/Connector.h @@ -91,7 +91,7 @@ struct MySQL_API MySQLConnectorRegistrator #if !defined(POCO_NO_AUTOMATIC_LIB_INIT) - #if defined(POCO_OS_FAMILY_WINDOWS) + #if defined(POCO_OS_FAMILY_WINDOWS) && !defined(__GNUC__) extern "C" const struct MySQL_API MySQLConnectorRegistrator pocoMySQLConnectorRegistrator; #if defined(MySQL_EXPORTS) #if defined(_WIN64) diff --git a/Data/ODBC/include/Poco/Data/ODBC/Connector.h b/Data/ODBC/include/Poco/Data/ODBC/Connector.h index 71b336af5..a8bc736b6 100644 --- a/Data/ODBC/include/Poco/Data/ODBC/Connector.h +++ b/Data/ODBC/include/Poco/Data/ODBC/Connector.h @@ -102,7 +102,7 @@ struct ODBC_API ODBCConnectorRegistrator #if !defined(POCO_NO_AUTOMATIC_LIB_INIT) - #if defined(POCO_OS_FAMILY_WINDOWS) + #if defined(POCO_OS_FAMILY_WINDOWS) && !defined(__GNUC__) extern "C" const struct ODBC_API ODBCConnectorRegistrator pocoODBCConnectorRegistrator; #if defined(ODBC_EXPORTS) #if defined(_WIN64) diff --git a/Data/SQLite/include/Poco/Data/SQLite/Connector.h b/Data/SQLite/include/Poco/Data/SQLite/Connector.h index ce1fbc3bb..45c7cb03d 100644 --- a/Data/SQLite/include/Poco/Data/SQLite/Connector.h +++ b/Data/SQLite/include/Poco/Data/SQLite/Connector.h @@ -110,7 +110,7 @@ struct SQLite_API SQLiteConnectorRegistrator #if !defined(POCO_NO_AUTOMATIC_LIB_INIT) - #if defined(POCO_OS_FAMILY_WINDOWS) + #if defined(POCO_OS_FAMILY_WINDOWS) && !defined(__GNUC__) extern "C" const struct SQLite_API SQLiteConnectorRegistrator pocoSQLiteConnectorRegistrator; #if defined(SQLite_EXPORTS) #if defined(_WIN64) || defined(_WIN32_WCE) diff --git a/Net/include/Poco/Net/Net.h b/Net/include/Poco/Net/Net.h index a7e90564b..cde84564e 100644 --- a/Net/include/Poco/Net/Net.h +++ b/Net/include/Poco/Net/Net.h @@ -90,7 +90,7 @@ inline void Net_API uninitializeNetwork(); // Automate network initialization (only relevant on Windows). // -#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_NO_AUTOMATIC_LIB_INIT) +#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_NO_AUTOMATIC_LIB_INIT) && !defined(__GNUC__) extern "C" const struct Net_API NetworkInitializer pocoNetworkInitializer; From 067adb9f2dc91aac7714f163628ce927df0e7680 Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Thu, 21 Aug 2014 14:31:48 -0500 Subject: [PATCH 2/5] Remove inlines to allow manual network inits. --- Net/include/Poco/Net/Net.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Net/include/Poco/Net/Net.h b/Net/include/Poco/Net/Net.h index cde84564e..c9934c4a9 100644 --- a/Net/include/Poco/Net/Net.h +++ b/Net/include/Poco/Net/Net.h @@ -73,12 +73,12 @@ namespace Poco { namespace Net { -inline void Net_API initializeNetwork(); +void Net_API initializeNetwork(); /// Initialize the network subsystem. /// (Windows only, no-op elsewhere) -inline void Net_API uninitializeNetwork(); +void Net_API uninitializeNetwork(); /// Uninitialize the network subsystem. /// (Windows only, no-op elsewhere) From f889dde50835942eb80e29dc4bdf90f32c39b82d Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Thu, 21 Aug 2014 14:36:37 -0500 Subject: [PATCH 3/5] Update MinGW config file. --- build/config/MinGW | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/config/MinGW b/build/config/MinGW index 91aeecad9..e9e579268 100644 --- a/build/config/MinGW +++ b/build/config/MinGW @@ -3,7 +3,7 @@ # # MinGW32 # -# Make settings for MinGW on WinXP +# Make settings for MinGW32 # # @@ -11,7 +11,7 @@ # LINKMODE = STATIC POCO_TARGET_OSNAME = MinGW -POCO_TARGET_OSARCH = ia32 +POCO_TARGET_OSARCH = i686 # # Define Tools @@ -66,9 +66,9 @@ RELEASEOPT_LINK = -O2 # # System Specific Flags # -SYSFLAGS = -D_WIN32 -DMINGW32 -DWINVER=0x500 -DPOCO_NO_FPENVIRONMENT -DPCRE_STATIC -DPOCO_THREAD_STACK_SIZE -DFoundation_Config_INCLUDED -I/usr/local/include -I/usr/include +SYSFLAGS = -D_WIN32 -DMINGW32 -DWINVER=0x501 -DPOCO_NO_FPENVIRONMENT -DPCRE_STATIC -DPOCO_THREAD_STACK_SIZE -I/usr/local/include -I/usr/include # # System Specific Libraries # -SYSLIBS = -L/usr/local/lib -L/usr/lib -liphlpapi -lws2_32 -lssl -lcrypto -lws2_32 -lgdi32 +SYSLIBS = -L/usr/local/lib -L/usr/lib -liphlpapi -lssl -lcrypto -lws2_32 From 95b8a940da2d0d780007cfe74a0bbda60d526b5f Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Thu, 21 Aug 2014 15:05:03 -0500 Subject: [PATCH 4/5] Add windmc stage to compile pocomsg.mc during MinGW builds. --- Foundation/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Foundation/Makefile b/Foundation/Makefile index e492adaed..800b22a50 100644 --- a/Foundation/Makefile +++ b/Foundation/Makefile @@ -59,4 +59,8 @@ target = PocoFoundation target_version = $(LIBVERSION) target_libs = +ifeq ($(findstring MinGW, $(POCO_CONFIG)), MinGW) + $(shell cd src; windmc pocomsg.mc) +endif + include $(POCO_BASE)/build/rules/lib From de82c34b4333b78c9b9de3f74cea733874472bdb Mon Sep 17 00:00:00 2001 From: Christopher Baker Date: Thu, 21 Aug 2014 16:21:53 -0500 Subject: [PATCH 5/5] Update Makefile to include Net.cpp compilation unit. --- Net/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Net/Makefile b/Net/Makefile index fa0ab16e9..3068e8ec6 100644 --- a/Net/Makefile +++ b/Net/Makefile @@ -11,7 +11,7 @@ include $(POCO_BASE)/build/rules/global SHAREDOPT_CXX += -DNet_EXPORTS objects = \ - DNS HTTPResponse HostEntry Socket \ + Net DNS HTTPResponse HostEntry Socket \ DatagramSocket HTTPServer IPAddress IPAddressImpl SocketAddress SocketAddressImpl \ HTTPBasicCredentials HTTPCookie HTMLForm MediaType DialogSocket \ DatagramSocketImpl FilePartSource HTTPServerConnection MessageHeader \