aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r--src/bitcoin-cli.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index b9e5a81f8d..0db2b75384 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -9,6 +9,7 @@
#include <chainparamsbase.h>
#include <clientversion.h>
+#include <compat.h>
#include <compat/stdin.h>
#include <policy/feerate.h>
#include <rpc/client.h>
@@ -1212,19 +1213,11 @@ static int CommandLineRPC(int argc, char *argv[])
return nRet;
}
-#ifdef WIN32
-// Export main() and ensure working ASLR on Windows.
-// Exporting a symbol will prevent the linker from stripping
-// the .reloc section from the binary, which is a requirement
-// for ASLR. This is a temporary workaround until a fixed
-// version of binutils is used for releases.
-__declspec(dllexport) int main(int argc, char* argv[])
+MAIN_FUNCTION
{
+#ifdef WIN32
util::WinCmdLineArgs winArgs;
std::tie(argc, argv) = winArgs.get();
-#else
-int main(int argc, char* argv[])
-{
#endif
SetupEnvironment();
if (!SetupNetworking()) {