Browse Source

Fix INTERNAL definition on Windows.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
5a5a40f5a2
3 changed files with 14 additions and 6 deletions
  1. +7
    -3
      include/common.hpp
  2. +5
    -1
      include/rack.hpp
  3. +2
    -2
      src/system.cpp

+ 7
- 3
include/common.hpp View File

@@ -23,16 +23,20 @@ E.g.

DEPRECATED void foo();
*/
#if defined(__GNUC__) || defined(__clang__)
#if defined __GNUC__ || defined __clang__
#define DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER)
#elif defined _MSC_VER
#define DEPRECATED __declspec(deprecated)
#endif

/** 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.
*/
#define INTERNAL __attribute__((visibility("hidden")))
#if defined ARCH_WIN
#define INTERNAL
#else
#define INTERNAL __attribute__((visibility("hidden")))
#endif


/** Concatenates two literals or two macros


+ 5
- 1
include/rack.hpp View File

@@ -100,7 +100,11 @@


#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 {


+ 2
- 2
src/system.cpp View File

@@ -520,7 +520,7 @@ std::string getStackTrace() {

for (int i = 1; i < stackLen; i++) {
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);
#endif
@@ -608,7 +608,7 @@ std::string getOperatingSystemInfo() {
info.dwOSVersionInfoSize = sizeof(info);
GetVersionExW(&info);
// 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
}



Loading…
Cancel
Save