diff options
-rw-r--r-- | compat/compat.cpp | 2 | ||||
-rw-r--r-- | compat/compat.h | 6 | ||||
-rw-r--r-- | facetracknoir/facetracknoir.cpp | 17 | ||||
-rw-r--r-- | facetracknoir/facetracknoir.h | 4 | ||||
-rw-r--r-- | facetracknoir/global-settings.cpp | 6 | ||||
-rw-r--r-- | facetracknoir/global-settings.h | 6 | ||||
-rw-r--r-- | facetracknoir/global-shortcuts.cpp | 2 | ||||
-rw-r--r-- | facetracknoir/shortcuts.cpp | 2 | ||||
-rw-r--r-- | facetracknoir/shortcuts.h | 4 | ||||
-rw-r--r-- | ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 4 | ||||
-rw-r--r-- | ftnoir_tracker_ht/ftnoir_tracker_ht.cpp | 6 |
11 files changed, 29 insertions, 30 deletions
diff --git a/compat/compat.cpp b/compat/compat.cpp index 8eedc845..d8aac9bc 100644 --- a/compat/compat.cpp +++ b/compat/compat.cpp @@ -7,7 +7,7 @@ #define IN_FTNOIR_COMPAT #include "compat.h" -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) PortableLockedShm::PortableLockedShm(const char* shmName, const char* mutexName, int mapSize) { diff --git a/compat/compat.h b/compat/compat.h index 7692b38a..6a95f167 100644 --- a/compat/compat.h +++ b/compat/compat.h @@ -6,7 +6,7 @@ */ #pragma once -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) #include <windows.h> #else #include <stdio.h> @@ -19,7 +19,7 @@ #include <sys/types.h> #endif -#if defined(IN_FTNOIR_COMPAT) && (defined(_WIN32) || defined(__WIN32)) +#if defined(IN_FTNOIR_COMPAT) && defined(_WIN32) # define COMPAT_EXPORT __declspec(dllexport) #else # define COMPAT_EXPORT @@ -33,7 +33,7 @@ public: void unlock(); void* mem; private: -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) HANDLE hMutex, hMapFile; #else int fd, size; diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp index 85607329..6ff1759b 100644 --- a/facetracknoir/facetracknoir.cpp +++ b/facetracknoir/facetracknoir.cpp @@ -27,14 +27,14 @@ #include <ftnoir_tracker_ht/ht-api.h> #include <QDebug> -#if defined(__WIN32) || defined(_WIN32) +#if defined(_WIN32) # include <windows.h> # include <dshow.h> #endif #if defined(__APPLE__) # define SONAME "dylib" -#elif defined(_WIN32) || defined(__WIN32) +#elif defined(_WIN32) # define SONAME "dll" #else # define SONAME "so" @@ -86,7 +86,7 @@ static void fill_combobox(const QString& filter, QList<DynamicLibrary*>& list, Q // Setup the Main Dialog // FaceTrackNoIR::FaceTrackNoIR(QWidget *parent, Qt::WFlags flags) : - #if defined(__WIN32) || defined(_WIN32) + #if defined(_WIN32) keybindingWorker(NULL), #else keyCenter(0), @@ -544,7 +544,7 @@ void FaceTrackNoIR::startTracker( ) { return; } -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) keybindingWorker = new KeybindingWorker(*this, keyCenter); keybindingWorker->start(); #endif @@ -657,7 +657,7 @@ void FaceTrackNoIR::startTracker( ) { /** stop tracking the face **/ void FaceTrackNoIR::stopTracker( ) { ui.game_name->setText("Not connected"); -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) if (keybindingWorker) { keybindingWorker->should_quit = true; @@ -958,7 +958,7 @@ void FaceTrackNoIR::bindKeyboardShortcuts() iniFile.beginGroup ( "KB_Shortcuts" ); int idxCenter = iniFile.value("Key_index_Center", 0).toInt(); -#if !defined(_WIN32) && !defined(__WIN32) +#if !defined(_WIN32) if (keyCenter) { delete keyCenter; keyCenter = NULL; @@ -979,7 +979,6 @@ void FaceTrackNoIR::bindKeyboardShortcuts() connect(keyCenter, SIGNAL(activated()), this, SLOT(shortcutRecentered())); } } - #else keyCenter.keycode = 0; keyCenter.shift = keyCenter.alt = keyCenter.ctrl = 0; @@ -993,7 +992,7 @@ void FaceTrackNoIR::bindKeyboardShortcuts() if (tracker) /* running already */ { -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) if (keybindingWorker) { keybindingWorker->should_quit = true; @@ -1011,7 +1010,7 @@ void FaceTrackNoIR::shortcutRecentered() { if (tracker) { -#if defined(__WIN32) || defined(_WIN32) +#if defined(_WIN32) MessageBeep(MB_OK); #else QApplication::beep(); diff --git a/facetracknoir/facetracknoir.h b/facetracknoir/facetracknoir.h index 763b5dad..8f83a851 100644 --- a/facetracknoir/facetracknoir.h +++ b/facetracknoir/facetracknoir.h @@ -44,7 +44,7 @@ #include <QKeySequence> #include <QtGui> #include <QString> -#if !defined(_WIN32) && !defined(__WIN32) +#if !defined(_WIN32) # include <qxtglobalshortcut.h> #else # include <windows.h> @@ -97,7 +97,7 @@ public: return *pose.axes[idx]; } -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) Key keyCenter; KeybindingWorker* keybindingWorker; #else diff --git a/facetracknoir/global-settings.cpp b/facetracknoir/global-settings.cpp index f605b591..4a655171 100644 --- a/facetracknoir/global-settings.cpp +++ b/facetracknoir/global-settings.cpp @@ -1,6 +1,6 @@ #include "global-settings.h" -#if !(defined(__WIN32) || defined(_WIN32)) +#if !(defined(_WIN32)) # include <dlfcn.h> #endif @@ -92,7 +92,7 @@ DynamicLibrary::DynamicLibrary(const QString& filename) { this->filename = filename; QString fullPath = QCoreApplication::applicationDirPath() + "/" + this->filename; -#if defined(__WIN32) || defined(_WIN32) +#if defined(_WIN32) handle = new QLibrary(fullPath); Dialog = (SETTINGS_FUNCTION) handle->resolve(MAYBE_STDCALL_UNDERSCORE "GetDialog" CALLING_CONVENTION_SUFFIX_VOID_FUNCTION); Constructor = (NULLARY_DYNAMIC_FUNCTION) handle->resolve(MAYBE_STDCALL_UNDERSCORE "GetConstructor" CALLING_CONVENTION_SUFFIX_VOID_FUNCTION); @@ -128,7 +128,7 @@ DynamicLibrary::DynamicLibrary(const QString& filename) DynamicLibrary::~DynamicLibrary() { -#if defined(__WIN32) || defined(_WIN32) +#if defined(_WIN32) handle->unload(); #else if (handle) diff --git a/facetracknoir/global-settings.h b/facetracknoir/global-settings.h index 29a8da62..b2a54e20 100644 --- a/facetracknoir/global-settings.h +++ b/facetracknoir/global-settings.h @@ -1,6 +1,6 @@ #pragma once -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) # define CALLING_CONVENTION_SUFFIX_VOID_FUNCTION "@0" # ifdef _MSC_VER # define MAYBE_STDCALL_UNDERSCORE "_" @@ -21,7 +21,7 @@ #include "ftnoir_filter_base/ftnoir_filter_base.h" #include "ftnoir_protocol_base/ftnoir_protocol_base.h" -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) # define CALLING_CONVENTION __stdcall #else # define CALLING_CONVENTION @@ -57,7 +57,7 @@ public: METADATA_FUNCTION Metadata; QString filename; private: -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) QLibrary* handle; #else void* handle; diff --git a/facetracknoir/global-shortcuts.cpp b/facetracknoir/global-shortcuts.cpp index 286200c0..8666333c 100644 --- a/facetracknoir/global-shortcuts.cpp +++ b/facetracknoir/global-shortcuts.cpp @@ -1,6 +1,6 @@ #include "facetracknoir/facetracknoir.h" -#if defined(__WIN32) || defined(_WIN32) +#if defined(_WIN32) #include <windows.h> #include <strmif.h> #include <dshow.h> diff --git a/facetracknoir/shortcuts.cpp b/facetracknoir/shortcuts.cpp index cf4b81f8..cdb2c3b7 100644 --- a/facetracknoir/shortcuts.cpp +++ b/facetracknoir/shortcuts.cpp @@ -125,7 +125,7 @@ void KeyboardShortcutDialog::save() { settingsDirty = false; } -#if defined(__WIN32) || defined(_WIN32) +#if defined(_WIN32) #include <windows.h> KeybindingWorkerImpl::~KeybindingWorkerImpl() { diff --git a/facetracknoir/shortcuts.h b/facetracknoir/shortcuts.h index 15256b6c..685c78b6 100644 --- a/facetracknoir/shortcuts.h +++ b/facetracknoir/shortcuts.h @@ -34,7 +34,7 @@ private slots: extern QList<QString> global_key_sequences; -#if defined(__WIN32) || defined(_WIN32) +#if defined(_WIN32) extern QList<int> global_windows_key_sequences; # undef DIRECTINPUT_VERSION # define DIRECTINPUT_VERSION 0x0800 @@ -60,7 +60,7 @@ typedef unsigned char BYTE; struct Key { int foo; }; #endif -#if defined(__WIN32) || defined(_WIN32) +#if defined(_WIN32) class KeybindingWorkerImpl { private: LPDIRECTINPUT8 din; diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index dcd91994..3f5960ef 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -17,7 +17,7 @@ #include <vector> #include <cstdio> -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) #include <dshow.h> #else #include <unistd.h> @@ -26,7 +26,7 @@ // delicious copypasta static QList<QString> get_camera_names(void) { QList<QString> ret; -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) // Create the System Device Enumerator. HRESULT hr; ICreateDevEnum *pSysDevEnum = NULL; diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp index 45c62f55..9be50efa 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp @@ -7,7 +7,7 @@ #include "facetracknoir/global-settings.h" #include <cmath> -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) #include <dshow.h> #else #include <unistd.h> @@ -16,7 +16,7 @@ // delicious copypasta static QList<QString> get_camera_names(void) { QList<QString> ret; -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) // Create the System Device Enumerator. HRESULT hr; ICreateDevEnum *pSysDevEnum = NULL; @@ -175,7 +175,7 @@ void Tracker::StartTracker(QFrame* videoframe) shm->pause = shm->terminate = shm->running = false; shm->timer = 0; subprocess.setWorkingDirectory(QCoreApplication::applicationDirPath() + "/tracker-ht"); -#if defined(_WIN32) || defined(__WIN32) +#if defined(_WIN32) subprocess.start("\"" + QCoreApplication::applicationDirPath() + "/tracker-ht/headtracker-ftnoir" + "\""); #else subprocess.start(QCoreApplication::applicationDirPath() + "/tracker-ht/headtracker-ftnoir"); |