--- a/src/astyle_main.h 2017-01-04 13:36:04.925151503 +0100 +++ b/src/astyle_main.h 2017-01-04 13:36:42.690152239 +0100 @@ -75,40 +75,6 @@ #endif #endif -#ifdef ASTYLE_LIB - - // define STDCALL and EXPORT for Windows - // MINGW defines STDCALL in Windows.h (actually windef.h) - // EXPORT has no value if ASTYLE_NO_EXPORT is defined - #ifdef _WIN32 - #ifndef STDCALL - #define STDCALL __stdcall - #endif - // define this to prevent compiler warning and error messages - #ifdef ASTYLE_NO_EXPORT - #define EXPORT - #else - #define EXPORT __declspec(dllexport) - #endif - // define STDCALL and EXPORT for non-Windows - // visibility attribute allows "-fvisibility=hidden" compiler option - #else - #define STDCALL - #if __GNUC__ >= 4 - #define EXPORT __attribute__ ((visibility ("default"))) - #else - #define EXPORT - #endif - #endif // #ifdef _WIN32 - - // define utf-16 bit text for the platform - typedef unsigned short utf16_t; - // define pointers to callback error handler and memory allocation - typedef void (STDCALL* fpError)(int errorNumber, const char* errorMessage); - typedef char* (STDCALL* fpAlloc)(unsigned long memoryNeeded); - -#endif // #ifdef ASTYLE_LIB - //---------------------------------------------------------------------------- // astyle namespace //---------------------------------------------------------------------------- --- a/src/astyle.h 2017-01-04 13:35:59.965151407 +0100 +++ b/src/astyle.h 2017-01-04 13:36:38.030152148 +0100 @@ -47,6 +47,42 @@ #pragma clang diagnostic ignored "-Wshorten-64-to-32" #endif +#ifdef ASTYLE_LIB + + // define STDCALL and EXPORT for Windows + // MINGW defines STDCALL in Windows.h (actually windef.h) + // EXPORT has no value if ASTYLE_NO_EXPORT is defined + #ifdef _WIN32 + #ifndef STDCALL + #define STDCALL __stdcall + #endif + // define this to prevent compiler warning and error messages + #ifdef ASTYLE_NO_EXPORT + #define EXPORT + #else + #define EXPORT __declspec(dllexport) + #endif + // define STDCALL and EXPORT for non-Windows + // visibility attribute allows "-fvisibility=hidden" compiler option + #else + #define STDCALL + #if __GNUC__ >= 4 + #define EXPORT __attribute__ ((visibility ("default"))) + #else + #define EXPORT + #endif + #endif // #ifdef _WIN32 + + // define utf-16 bit text for the platform + typedef unsigned short utf16_t; + // define pointers to callback error handler and memory allocation + typedef void (STDCALL* fpError)(int errorNumber, const char* errorMessage); + typedef char* (STDCALL* fpAlloc)(unsigned long memoryNeeded); + +#else + #define EXPORT +#endif // #ifdef ASTYLE_LIB + //----------------------------------------------------------------------------- // astyle namespace //----------------------------------------------------------------------------- @@ -326,7 +326,7 @@ // Class ASBeautifier //----------------------------------------------------------------------------- -class ASBeautifier : protected ASResource, protected ASBase +class EXPORT ASBeautifier : protected ASResource, protected ASBase { public: ASBeautifier(); @@ -612,7 +646,7 @@ // Class ASFormatter //----------------------------------------------------------------------------- -class ASFormatter : public ASBeautifier +class EXPORT ASFormatter : public ASBeautifier { public: // functions ASFormatter();