Implemented automated network library initialization for Windows MinGW targets (#4402)

* Implemented automated network library initialization for Windows MinGW/GCC targets

* Using POCO_COMPILER_MINGW instead of __GNUC__

---------

Co-authored-by: Jesse Hoogervorst <jesse@deltaxlab.com>
This commit is contained in:
Jesse Hoogervorst 2024-01-17 14:51:23 +01:00 committed by Aleksandar Fabijanic
parent b5745033a7
commit 696ddac0d8

View File

@ -101,11 +101,13 @@ std::string htmlize(const std::string& str);
// Automate network initialization (only relevant on Windows).
//
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_NO_AUTOMATIC_LIB_INIT) && !defined(__GNUC__)
#if defined(POCO_OS_FAMILY_WINDOWS) && !defined(POCO_NO_AUTOMATIC_LIB_INIT)
extern "C" const struct Net_API NetworkInitializer pocoNetworkInitializer;
#if defined(Net_EXPORTS)
#if defined(POCO_COMPILER_MINGW)
#define POCO_NET_FORCE_SYMBOL(x) static void *__ ## x ## _fp = (void*)&x;
#elif defined(Net_EXPORTS)
#if defined(_WIN64)
#define POCO_NET_FORCE_SYMBOL(s) __pragma(comment (linker, "/export:"#s))
#elif defined(_WIN32)