alter platform-dependent preprocessor macros to use the same names as the rest of the ardour codebase

This commit is contained in:
Paul Davis 2014-05-01 09:32:18 -04:00
parent 1c77df4d8f
commit 12d5a33626
16 changed files with 61 additions and 63 deletions

View file

@ -30,7 +30,7 @@ template<class T> inline T WUMinMax(const T &Smallest, const T &Biggest, const T
}
*/
// Absolute value
#ifdef _WINDOWS
#ifdef PLATFORM_WINDOWS
#include <math.h>
#define __abs(x) abs(x)
#define __labs(x) labs(x)
@ -45,7 +45,7 @@ template<class T> inline T WUMinMax(const T &Smallest, const T &Biggest, const T
#define __labs(x) std::labs(x)
#define __fabs(x) std::fabs(x)
#endif
#ifdef __MACOS__
#ifdef __APPLE__
#ifdef __GNUC__
#include <iostream> // why don't know makes it work need to check
#include <cmath>
@ -57,7 +57,7 @@ template<class T> inline T WUMinMax(const T &Smallest, const T &Biggest, const T
// log2: on Windows there's no proper definition for log2, whereas on other platform there is.
#ifndef WUlog2
#if defined(_WINDOWS)
#if defined(PLATFORM_WINDOWS)
#define WUlog2(x) (kdOneOverLog2 * log10((x)))
#else
#define WUlog2(x) log2(x)

View file

@ -16,10 +16,10 @@ class DllExport UMicroseconds
{
public:
#ifdef _WINDOWS
#ifdef PLATFORM_WINDOWS
typedef int64_t TimeKeeper;
#endif
#ifdef __MACOS__
#ifdef __APPLE__
typedef uint64_t TimeKeeper;
#endif
#ifdef __linux__
@ -52,7 +52,7 @@ public:
double MilliSeconds() const {return static_cast<double>(theTime) / double(1000);}
double MicroSeconds() const {return static_cast<double>(theTime);}
#ifdef __MACOS__
#ifdef __APPLE__
uint32_t hi();
uint32_t lo();
#endif

View file

@ -12,7 +12,7 @@
#include <cstring>
#include <cstdio>
#ifdef __MACOS__
#ifdef __APPLE__
#include <strings.h>
#endif
@ -28,7 +28,7 @@
#ifdef __POSIX__
const char* const kStrNewLine = "\n";
#endif
#ifdef _WINDOWS
#ifdef PLATFORM_WINDOWS
const char* const kStrNewLine = "\r\n";
#endif
@ -256,10 +256,10 @@ public:
const unsigned int tempBufSize = 32;
char buf[tempBufSize];
#ifdef _WINDOWS
#ifdef PLATFORM_WINDOWS
_snprintf_s(buf, tempBufSize, tempBufSize - 1, "%.*f", in_precision, in_double);
#endif
#ifdef __MACOS__
#ifdef __APPLE__
std::snprintf(buf, tempBufSize, "%.*f", in_precision, in_double);
#endif
#ifdef __linux__
@ -356,7 +356,7 @@ public:
// warning which we do not know how to solve yet. The function DummyFunctionsForWarningTest
// in file WCFixedStringStream.cpp calls all combinations of operator<<(unsigned something)
// And should produce no warnings - (except the C4267 on windows).
#if defined(__MACOS__) // both 32 & 64 bit
#if defined(__APPLE__) // both 32 & 64 bit
WCFixedStringBase& operator<<(const size_t in_uint) {
return operator<<(static_cast<unsigned long long>(in_uint));
}
@ -369,13 +369,13 @@ public:
// return operator<<(static_cast<const uint64_t>(in_uint));
// }
//
#if defined(__MACOS__) || defined(_WINDOWS) || defined(__linux__) // both 32 & 64 bit
#if defined(__APPLE__) || defined(PLATFORM_WINDOWS) || defined(__linux__) // both 32 & 64 bit
WCFixedStringBase& operator<<(const unsigned int in_uint) {
return operator<<(static_cast<uint64_t>(in_uint));
}
#endif
//
#if defined(_WINDOWS) || defined(__linux__) // both 32 & 64 bit
#if defined(PLATFORM_WINDOWS) || defined(__linux__) // both 32 & 64 bit
WCFixedStringBase& operator<<(const unsigned long in_uint) {
return operator<<(static_cast<uint64_t>(in_uint));
}
@ -385,7 +385,7 @@ public:
{
if (in_int < 0)
operator<<('-');
#ifdef _WINDOWS
#ifdef PLATFORM_WINDOWS
// uintmax_t unsigned_in_num = _abs64(in_int);
uintmax_t unsigned_in_num = in_int < 0 ? static_cast<uintmax_t>(-in_int) : static_cast<uintmax_t>(in_int);
#else
@ -464,10 +464,10 @@ public:
if (0 != in_to_compare)
{
#ifdef _WINDOWS
#ifdef PLATFORM_WINDOWS
retVal = _stricmp(c_str(), in_to_compare);
#endif
#if defined(__linux__) || defined(__MACOS__)
#if defined(__linux__) || defined(__APPLE__)
retVal = strcasecmp(c_str(), in_to_compare);
#endif
}