aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-08-19 15:22:28 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-08-19 15:53:03 -0300
commit307e16cc9378a96cb937e44f42bb6a1548c77a99 (patch)
treef2aa18b0c0656d63194c743fc830aad33e94e1ce
parentf056f08a8495f89037292b3c273aba254610ee8a (diff)
Fix problems with dllimport/dllexport in some shiboken functions/variables.
-rw-r--r--libshiboken/basewrapper.h10
-rw-r--r--libshiboken/pyenum.h6
-rw-r--r--libshiboken/shibokenmacros.h19
3 files changed, 17 insertions, 18 deletions
diff --git a/libshiboken/basewrapper.h b/libshiboken/basewrapper.h
index 7403491f6..703c46532 100644
--- a/libshiboken/basewrapper.h
+++ b/libshiboken/basewrapper.h
@@ -72,8 +72,8 @@ typedef bool (*ExtendedIsConvertibleFunc)(PyObject*);
// Used in userdata dealloc function
typedef void (*DeleteUserDataFunc)(void*);
-LIBSHIBOKEN_API PyAPI_DATA(PyTypeObject) SbkBaseWrapperType_Type;
-LIBSHIBOKEN_API PyAPI_DATA(SbkBaseWrapperType) SbkBaseWrapper_Type;
+extern LIBSHIBOKEN_API PyTypeObject SbkBaseWrapperType_Type;
+extern LIBSHIBOKEN_API SbkBaseWrapperType SbkBaseWrapper_Type;
class LIBSHIBOKEN_API TypeDiscovery {
public:
@@ -217,13 +217,13 @@ LIBSHIBOKEN_API bool canCallConstructor(PyTypeObject* myType, PyTypeObject* ctor
#define SbkBaseWrapper_validCppObject(pyobj) (((Shiboken::SbkBaseWrapper*)pyobj)->validCppObject)
#define SbkBaseWrapper_setValidCppObject(pyobj,v) (((Shiboken::SbkBaseWrapper*)pyobj)->validCppObject = v)
-LIBSHIBOKEN_API PyAPI_FUNC(PyObject*)
+LIBSHIBOKEN_API PyObject*
SbkBaseWrapper_New(SbkBaseWrapperType* instanceType,
void* cptr,
bool hasOwnership = true,
bool isExactType = false);
-LIBSHIBOKEN_API PyAPI_FUNC(PyObject*)
+LIBSHIBOKEN_API PyObject*
SbkBaseWrapper_TpNew(PyTypeObject* subtype, PyObject*, PyObject*);
/**
@@ -253,7 +253,7 @@ void callCppDestructor(void* cptr)
delete reinterpret_cast<T*>(cptr);
}
-LIBSHIBOKEN_API PyAPI_FUNC(void) deallocWrapperWithPrivateDtor(PyObject* self);
+LIBSHIBOKEN_API void deallocWrapperWithPrivateDtor(PyObject* self);
LIBSHIBOKEN_API bool importModule(const char* moduleName, PyTypeObject*** cppApiPtr);
LIBSHIBOKEN_API void setErrorAboutWrongArguments(PyObject* args, const char* funcName, const char** cppOverloads);
diff --git a/libshiboken/pyenum.h b/libshiboken/pyenum.h
index 43a8d5142..1a5bfae5a 100644
--- a/libshiboken/pyenum.h
+++ b/libshiboken/pyenum.h
@@ -50,10 +50,10 @@ typedef struct {
PyObject* ob_name;
} SbkEnumObject;
-LIBSHIBOKEN_API PyAPI_DATA(PyTypeObject) SbkEnumType_Type;
+extern LIBSHIBOKEN_API PyTypeObject SbkEnumType_Type;
-LIBSHIBOKEN_API PyAPI_FUNC(PyObject*) SbkEnumObject_repr(PyObject* self);
-LIBSHIBOKEN_API PyAPI_FUNC(PyObject*) SbkEnumObject_name(PyObject* self);
+LIBSHIBOKEN_API PyObject* SbkEnumObject_repr(PyObject* self);
+LIBSHIBOKEN_API PyObject* SbkEnumObject_name(PyObject* self);
} // extern "C"
diff --git a/libshiboken/shibokenmacros.h b/libshiboken/shibokenmacros.h
index 5ef1718c5..bec0f56c8 100644
--- a/libshiboken/shibokenmacros.h
+++ b/libshiboken/shibokenmacros.h
@@ -1,7 +1,7 @@
/*
* This file is part of the Shiboken Python Bindings Generator project.
*
-* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: PySide team <contact@pyside.org>
*
@@ -35,21 +35,20 @@
#ifndef SHIBOKENMACROS_H
#define SHIBOKENMACROS_H
-// LIBSHIBOKEN_API is used for the public API symbols.
-// LIBSHIBOKEN_LOCAL is used for non-api symbols, i.e. internal functions and classes.
-// Generic helper definitions for shared library support
+// LIBSHIBOKEN_API macro is used for the public API symbols.
#if defined _WIN32 || defined __CYGWIN__
#if LIBSHIBOKEN_EXPORTS
#define LIBSHIBOKEN_API __declspec(dllexport)
#else
- #define LIBSHIBOKEN_API
+ #ifdef _MSC_VER
+ #define LIBSHIBOKEN_API __declspec(dllimport)
+ #endif
#endif
-#else
-#if __GNUC__ >= 4
+#elif __GNUC__ >= 4
#define LIBSHIBOKEN_API __attribute__ ((visibility("default")))
-#else
- #define LIBSHIBOKEN_API
-#endif
#endif
+#ifndef LIBSHIBOKEN_API
+ #define LIBSHIBOKEN_API
+#endif
#endif