Skip to content

Commit

Permalink
Implemented automated network library initialization for Windows MinG…
Browse files Browse the repository at this point in the history
…W 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>
  • Loading branch information
2 people authored and aleks-f committed Jan 17, 2024
1 parent b574503 commit 696ddac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Net/include/Poco/Net/Net.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 696ddac

Please sign in to comment.