SWDEV-301289 - Treewide macro rename

ATI_OS_WIN -> _WIN32
ATI_OS_LINUX -> __linux__

We should not rely on non-standard macros for platform detections.

Change-Id: If1d06e2e1187268df62a59609ea5496ab7eb709d
Цей коміт міститься в:
Vladislav Sytchenko
2021-08-30 14:04:35 -04:00
зафіксовано Jason Tang
джерело 159f7f24cd
коміт c4aa6febe5
27 змінених файлів з 92 додано та 93 видалено
+10 -10
Переглянути файл
@@ -20,22 +20,22 @@
#include "Timer.h"
#ifdef ATI_OS_WIN
#ifdef _WIN32
#include <windows.h>
#endif
#ifdef ATI_OS_LINUX
#ifdef __linux__
#include <sys/time.h>
#endif
CPerfCounter::CPerfCounter() : _clocks(0), _start(0) {
#ifdef ATI_OS_WIN
#ifdef _WIN32
QueryPerformanceFrequency((LARGE_INTEGER *)&_freq);
#endif
#ifdef ATI_OS_LINUX
#ifdef __linux__
_freq = 1000;
#endif
}
@@ -45,7 +45,7 @@ CPerfCounter::~CPerfCounter() {
}
void CPerfCounter::Start(void) {
#ifdef ATI_OS_WIN
#ifdef _WIN32
if (_start) {
MessageBox(NULL, "Bad Perf Counter Start", "Error", MB_OK);
@@ -54,7 +54,7 @@ void CPerfCounter::Start(void) {
QueryPerformanceCounter((LARGE_INTEGER *)&_start);
#endif
#ifdef ATI_OS_LINUX
#ifdef __linux__
struct timeval s;
gettimeofday(&s, 0);
@@ -66,7 +66,7 @@ void CPerfCounter::Start(void) {
void CPerfCounter::Stop(void) {
i64 n;
#ifdef ATI_OS_WIN
#ifdef _WIN32
if (!_start) {
MessageBox(NULL, "Bad Perf Counter Stop", "Error", MB_OK);
@@ -76,7 +76,7 @@ void CPerfCounter::Stop(void) {
QueryPerformanceCounter((LARGE_INTEGER *)&n);
#endif
#ifdef ATI_OS_LINUX
#ifdef __linux__
struct timeval s;
gettimeofday(&s, 0);
@@ -90,7 +90,7 @@ void CPerfCounter::Stop(void) {
}
void CPerfCounter::Reset(void) {
#ifdef ATI_OS_WIN
#ifdef _WIN32
if (_start) {
MessageBox(NULL, "Bad Perf Counter Reset", "Error", MB_OK);
exit(0);
@@ -100,7 +100,7 @@ void CPerfCounter::Reset(void) {
}
double CPerfCounter::GetElapsedTime(void) {
#ifdef ATI_OS_WIN
#ifdef _WIN32
if (_start) {
MessageBox(NULL, "Trying to get time while still running.", "Error", MB_OK);
exit(0);
+2 -2
Переглянути файл
@@ -21,10 +21,10 @@
#ifndef _TIMER_H_
#define _TIMER_H_
#ifdef ATI_OS_WIN
#ifdef _WIN32
typedef __int64 i64;
#endif
#ifdef ATI_OS_LINUX
#ifdef __linux__
typedef long long i64;
#endif
+1 -1
Переглянути файл
@@ -147,7 +147,7 @@ int oclSysInfo(std::string &info_string, bool use_cpu, unsigned dev_id,
clGetDeviceInfo(device, CL_DEVICE_BOARD_NAME_AMD, sizeof(c), &c, NULL);
sprintf(tmpString, "\tBoard Name: %s\n", c);
info_string.append(tmpString);
#if defined(ATI_OS_LINUX)
#if defined(__linux__)
cl_device_topology_amd topology;
clGetDeviceInfo(device, CL_DEVICE_TOPOLOGY_AMD, sizeof(topology), &topology,
NULL);
+17 -17
Переглянути файл
@@ -22,7 +22,7 @@
#include <CL/cl.h>
#ifdef ATI_OS_WIN
#ifdef _WIN32
#include <windows.h>
#include "Window.h"
@@ -31,7 +31,7 @@ typedef HMODULE ModuleHandle;
/////////////////////////////////////////////////////////////////////////////
#ifdef ATI_OS_LINUX
#ifdef __linux__
#include <dlfcn.h>
typedef void* ModuleHandle;
#endif
@@ -68,7 +68,7 @@ static OCLutil::Lock moduleLock;
/////////////////////////////////////////////////////////////////////////////
#ifdef ATI_OS_WIN
#ifdef _WIN32
static LONG WINAPI xFilter(LPEXCEPTION_POINTERS xEP);
void serviceStubCall();
#endif
@@ -386,7 +386,7 @@ void App::printOCLinfo(void) {
/*-----------------------------------------------------
Function to randomize the order in which tests are executed
-------------------------------------------------------*/
#ifdef ATI_OS_WIN
#ifdef _WIN32
#include <time.h>
#endif
// void App::SetTestRunOrder(int test_count)
@@ -745,7 +745,7 @@ void App::PrintTestOrder(int mod_index) {
//! Function that runs all the tests specified in the command-line
void App::RunAllTests() {
#ifdef ATI_OS_WIN
#ifdef _WIN32
if (!m_console) m_window = new Window("Test", 100, 100, m_width, m_height, 0);
#endif
@@ -889,7 +889,7 @@ void App::RunAllTests() {
"##teamcity[testSuiteFinished name='ocltst']\n");
}
#ifdef ATI_OS_WIN
#ifdef _WIN32
if (!m_console && m_window) {
((Window*)m_window)->ConsumeEvents();
}
@@ -1374,7 +1374,7 @@ void App::ScanForTests() {
for (unsigned int i = 0; i < m_paths.size(); i++) {
Module mod;
#ifdef ATI_OS_WIN
#ifdef _WIN32
std::string::iterator myIter;
myIter = m_paths[i].end();
myIter--;
@@ -1382,20 +1382,20 @@ void App::ScanForTests() {
mod.hmodule = LoadLibrary(m_paths[i].c_str());
#endif
#ifdef ATI_OS_LINUX
#ifdef __linux__
mod.hmodule = dlopen(m_paths[i].c_str(), RTLD_NOW);
#endif
if (mod.hmodule == NULL) {
fprintf(stderr, "Could not load module: %s\n", m_paths[i].c_str());
#ifdef ATI_OS_LINUX
#ifdef __linux__
fprintf(stderr, "Error : %s\n", dlerror());
#else
#endif
} else {
mod.name = m_paths[i];
#ifdef ATI_OS_WIN
#ifdef _WIN32
mod.get_count = (TestCountFuncPtr)GetProcAddress(mod.hmodule,
"OCLTestList_TestCount");
mod.get_name =
@@ -1409,7 +1409,7 @@ void App::ScanForTests() {
mod.get_libname = (TestLibNameFuncPtr)GetProcAddress(
mod.hmodule, "OCLTestList_TestLibName");
#endif
#ifdef ATI_OS_LINUX
#ifdef __linux__
mod.get_count =
(TestCountFuncPtr)dlsym(mod.hmodule, "OCLTestList_TestCount");
mod.get_name =
@@ -1437,15 +1437,15 @@ void App::CleanUp() {
if (m_modules[i].cached_test) {
delete[] m_modules[i].cached_test;
}
#ifdef ATI_OS_WIN
#ifdef _WIN32
FreeLibrary(m_modules[i].hmodule);
#endif
#ifdef ATI_OS_LINUX
#ifdef __linux__
dlclose(m_modules[i].hmodule);
#endif
}
#ifdef ATI_OS_WIN
#ifdef _WIN32
if (m_window) delete m_window;
m_window = 0;
#endif
@@ -1461,7 +1461,7 @@ int main(int argc, char** argv) {
// reset optind as we really didn't parse the full command line
optind = 1;
App app(platform);
#ifdef ATI_OS_WIN
#ifdef _WIN32
// this function is registers windows service routine when ocltst is launched
// by the OS on service initialization. On other scenarios, this function does
// nothing.
@@ -1469,7 +1469,7 @@ int main(int argc, char** argv) {
// SetErrorMode(SEM_NOGPFAULTERRORBOX);
// const LPTOP_LEVEL_EXCEPTION_FILTER oldFilter =
// SetUnhandledExceptionFilter(xFilter);
#endif // ATI_OS_WIN
#endif // _WIN32
#ifdef AUTO_REGRESS
try {
#endif /* AUTO_REGRESS */
@@ -1490,7 +1490,7 @@ int main(int argc, char** argv) {
return 0;
}
#ifdef ATI_OS_WIN
#ifdef _WIN32
#include <dbghelp.h>
+1 -1
Переглянути файл
@@ -20,7 +20,7 @@
#include "pfm.h"
#ifdef ATI_OS_WIN
#ifdef _WIN32
#include <io.h>
#endif
+2 -2
Переглянути файл
@@ -18,7 +18,7 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. */
#ifdef ATI_OS_WIN
#ifdef _WIN32
#include <assert.h>
#include <stdio.h>
@@ -172,4 +172,4 @@ void Window::ShowImage(unsigned int width, unsigned int height, float* data) {
OnPaint();
}
#endif // ATI_OS_WIN
#endif // _WIN32
+2 -2
Переглянути файл
@@ -21,7 +21,7 @@
#ifndef _WINDOW_H_
#define _WINDOW_H_
#ifdef ATI_OS_WIN
#ifdef _WIN32
#include <gl\gl.h>
#include <windows.h>
@@ -50,6 +50,6 @@ class Window {
static unsigned int _h;
};
#endif // ATI_OS_WIN
#endif // _WIN32
#endif // _WINDOW_H_