@@ -23,16 +23,20 @@ E.g. | |||||
DEPRECATED void foo(); | DEPRECATED void foo(); | ||||
*/ | */ | ||||
#if defined(__GNUC__) || defined(__clang__) | |||||
#if defined __GNUC__ || defined __clang__ | |||||
#define DEPRECATED __attribute__((deprecated)) | #define DEPRECATED __attribute__((deprecated)) | ||||
#elif defined(_MSC_VER) | |||||
#elif defined _MSC_VER | |||||
#define DEPRECATED __declspec(deprecated) | #define DEPRECATED __declspec(deprecated) | ||||
#endif | #endif | ||||
/** Attribute for private functions and symbols not intended to be used by plugins. | /** Attribute for private functions and symbols not intended to be used by plugins. | ||||
By default this does nothing, but when #including rack.hpp, it prints a compile-time warning. | By default this does nothing, but when #including rack.hpp, it prints a compile-time warning. | ||||
*/ | */ | ||||
#define INTERNAL __attribute__((visibility("hidden"))) | |||||
#if defined ARCH_WIN | |||||
#define INTERNAL | |||||
#else | |||||
#define INTERNAL __attribute__((visibility("hidden"))) | |||||
#endif | |||||
/** Concatenates two literals or two macros | /** Concatenates two literals or two macros | ||||
@@ -100,7 +100,11 @@ | |||||
#undef INTERNAL | #undef INTERNAL | ||||
#define INTERNAL __attribute__((visibility("hidden"))) __attribute__((error("Using function or symbol internal to Rack"))) | |||||
#if defined ARCH_WIN | |||||
#define INTERNAL __attribute__((error("Using internal Rack function or symbol"))) | |||||
#elif | |||||
#define INTERNAL __attribute__((visibility("hidden"))) __attribute__((error("Using internal Rack function or symbol"))) | |||||
#endif | |||||
namespace rack { | namespace rack { | ||||
@@ -520,7 +520,7 @@ std::string getStackTrace() { | |||||
for (int i = 1; i < stackLen; i++) { | for (int i = 1; i < stackLen; i++) { | ||||
SymFromAddr(process, (DWORD64) stack[i], 0, symbol); | SymFromAddr(process, (DWORD64) stack[i], 0, symbol); | ||||
s += string::f("%d: %s 0x%0x\n", stackLen - i - 1, symbol->Name, symbol->Address); | |||||
s += string::f("%d: %s 0x%" PRIx64 "\n", stackLen - i - 1, symbol->Name, symbol->Address); | |||||
} | } | ||||
free(symbol); | free(symbol); | ||||
#endif | #endif | ||||
@@ -608,7 +608,7 @@ std::string getOperatingSystemInfo() { | |||||
info.dwOSVersionInfoSize = sizeof(info); | info.dwOSVersionInfoSize = sizeof(info); | ||||
GetVersionExW(&info); | GetVersionExW(&info); | ||||
// See https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ns-winnt-_osversioninfoa for a list of Windows version numbers. | // See https://docs.microsoft.com/en-us/windows/desktop/api/winnt/ns-winnt-_osversioninfoa for a list of Windows version numbers. | ||||
return string::f("Windows %u.%u", info.dwMajorVersion, info.dwMinorVersion); | |||||
return string::f("Windows %lu.%lu", info.dwMajorVersion, info.dwMinorVersion); | |||||
#endif | #endif | ||||
} | } | ||||