summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-22 22:48:45 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-22 22:48:45 +0200
commit29d11bc97afb5932aa1d394a6df295a364d983a9 (patch)
treee9d577f0b91627ff182ce4fcb14f4d94e5892138 /facetracknoir
parentd2809d533b7b0b85dec34fe31c1d4fa023cd5259 (diff)
get rid of evil CALLING_CONVENTION macro
Diffstat (limited to 'facetracknoir')
-rw-r--r--facetracknoir/plugin-api.hpp6
-rw-r--r--facetracknoir/plugin-support.cpp11
-rw-r--r--facetracknoir/plugin-support.h20
3 files changed, 7 insertions, 30 deletions
diff --git a/facetracknoir/plugin-api.hpp b/facetracknoir/plugin-api.hpp
index d458d25c..f352a6a9 100644
--- a/facetracknoir/plugin-api.hpp
+++ b/facetracknoir/plugin-api.hpp
@@ -2,12 +2,6 @@
#include "facetracknoir/export.hpp"
-#if defined(_WIN32)
-# define CALLING_CONVENTION __stdcall
-#else
-# define CALLING_CONVENTION
-#endif
-
enum Axis {
TX = 0, TY, TZ, Yaw, Pitch, Roll
};
diff --git a/facetracknoir/plugin-support.cpp b/facetracknoir/plugin-support.cpp
index c6622fe0..35cf8f29 100644
--- a/facetracknoir/plugin-support.cpp
+++ b/facetracknoir/plugin-support.cpp
@@ -1,11 +1,8 @@
+#include <cstdio>
#include "plugin-support.h"
#include <QCoreApplication>
#include <QFile>
-#if !(defined(_WIN32))
-# include <dlfcn.h>
-#endif
-
SelectedLibraries* Libraries = NULL;
SelectedLibraries::~SelectedLibraries()
@@ -88,15 +85,15 @@ DynamicLibrary::DynamicLibrary(const QString& filename) :
if (_foo::die(handle, !handle->load()))
return;
- Dialog = (DIALOG_FUNPTR) handle->resolve(MAYBE_STDCALL_UNDERSCORE "GetDialog" CALLING_CONVENTION_SUFFIX_VOID_FUNCTION);
+ Dialog = (DIALOG_FUNPTR) handle->resolve("GetDialog");
if (_foo::die(handle, !Dialog))
return;
- Constructor = (CTOR_FUNPTR) handle->resolve(MAYBE_STDCALL_UNDERSCORE "GetConstructor" CALLING_CONVENTION_SUFFIX_VOID_FUNCTION);
+ Constructor = (CTOR_FUNPTR) handle->resolve("GetConstructor");
if (_foo::die(handle, !Constructor))
return;
- Metadata = (METADATA_FUNPTR) handle->resolve(MAYBE_STDCALL_UNDERSCORE "GetMetadata" CALLING_CONVENTION_SUFFIX_VOID_FUNCTION);
+ Metadata = (METADATA_FUNPTR) handle->resolve("GetMetadata");
if (_foo::die(handle, !Metadata))
return;
#else
diff --git a/facetracknoir/plugin-support.h b/facetracknoir/plugin-support.h
index 1e02bd60..3924fc09 100644
--- a/facetracknoir/plugin-support.h
+++ b/facetracknoir/plugin-support.h
@@ -2,20 +2,6 @@
#include "facetracknoir/plugin-api.hpp"
-#if defined(_WIN32)
-# define CALLING_CONVENTION_SUFFIX_VOID_FUNCTION "@0"
-# ifdef _MSC_VER
-# error "No support for MSVC anymore"
-#else
-# define MAYBE_STDCALL_UNDERSCORE ""
-# endif
-#else
-# define CALLING_CONVENTION_SUFFIX_VOID_FUNCTION ""
-# define MAYBE_STDCALL_UNDERSCORE ""
-#endif
-
-#include <cstdio>
-
#include <QWidget>
#include <QDebug>
#include <QString>
@@ -38,9 +24,9 @@ extern SelectedLibraries* Libraries;
struct Metadata;
-extern "C" typedef void* (CALLING_CONVENTION * CTOR_FUNPTR)(void);
-extern "C" typedef Metadata* (CALLING_CONVENTION* METADATA_FUNPTR)(void);
-extern "C" typedef void* (CALLING_CONVENTION* DIALOG_FUNPTR)(void);
+extern "C" typedef void* (*CTOR_FUNPTR)(void);
+extern "C" typedef Metadata* (*METADATA_FUNPTR)(void);
+extern "C" typedef void* (*DIALOG_FUNPTR)(void);
class DynamicLibrary {
public: