From 9baade2cb547f591f00e05c1940d126b685b1bb1 Mon Sep 17 00:00:00 2001 From: jbrodman Date: Mon, 23 Feb 2015 11:43:06 -0800 Subject: [PATCH 1/2] Change dll export feature to a switch. --- ispc.cpp | 1 + ispc.h | 3 +++ main.cpp | 3 +++ module.cpp | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ispc.cpp b/ispc.cpp index cf310f89..0350d737 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -1075,6 +1075,7 @@ Globals::Globals() { FATAL("Current directory path too long!"); #endif forceAlignment = -1; + dllExport = false; } /////////////////////////////////////////////////////////////////////////// diff --git a/ispc.h b/ispc.h index 095850fc..cec56056 100644 --- a/ispc.h +++ b/ispc.h @@ -612,6 +612,9 @@ struct Globals { /** Indicates that alignment in memory allocation routines should be forced to have given value. -1 value means natural alignment for the platforms. */ int forceAlignment; + + /** When true, flag non-static functions with dllexport attribute on Windows. */ + bool dllExport; }; enum { diff --git a/main.cpp b/main.cpp index 9250a3c5..7128dcaa 100644 --- a/main.cpp +++ b/main.cpp @@ -153,6 +153,7 @@ devUsage(int ret) { lPrintVersion(); printf("\nusage (developer options): ispc\n"); printf(" [--debug]\t\t\t\tPrint information useful for debugging ispc\n"); + printf(" [--dllexport]\t\t\tMake non-static functions DLL exported. Windows only."); printf(" [--fuzz-test]\t\t\tRandomly perturb program input to test error conditions\n"); printf(" [--fuzz-seed=]\t\tSeed value for RNG for fuzz testing\n"); printf(" [--opt=