Spu2null, padnull, gsnull, CDVDnull, onepad, spu2x:

Add 2 attributes to the interfaces functions
 - externally_visible: avoid gcc to remove the function when lto is enabled 
 - visibility("default"): default == public... Allow to hide all others symbols: see http://gcc.gnu.org/wiki/Visibility for details

onepad:
* Remove __cplusplus define, everythings is in C
* define 2 interfaces functions with EXPORT_C_ instead of CALLBACK.

cmake:
* add recent added .h files
* add fvisibility optimization. Plugins size was reduced of ~10% much more than expected :)


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3611 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2010-08-06 11:43:21 +00:00
parent cfc4c9b3ec
commit 04e6c5ab02
16 changed files with 24 additions and 28 deletions

View File

@ -30,7 +30,7 @@
#include <gtk/gtk.h>
#include <cstring>
#define EXPORT_C_(type) extern "C" type
#define EXPORT_C_(type) extern "C" __attribute__((externally_visible,visibility("default"))) type
#endif
//#include "PS2Edefs.h"

View File

@ -35,7 +35,7 @@
#ifdef _MSC_VER
#define EXPORT_C(type) extern "C" __declspec(dllexport) type CALLBACK
#else
#define EXPORT_C(type) extern "C" type
#define EXPORT_C(type) extern "C" __attribute__((externally_visible,visibility("default"))) type
#endif
EXPORT_C(u32) PS2EgetLibType(void);

View File

@ -96,6 +96,8 @@ endif(CMAKE_BUILD_TYPE STREQUAL Release)
set(UtilitiesSources
../../include/Utilities/FixedPointTypes.inl
../../include/Utilities/EventSource.inl
../../include/Utilities/SafeArray.inl
../../include/Utilities/TlsVariable.inl
AlignedMalloc.cpp
CheckedStaticBox.cpp
Console.cpp
@ -156,6 +158,7 @@ set(UtilitiesHeaders
../../include/Utilities/StringHelpers.h
../../include/Utilities/Threading.h
../../include/Utilities/ThreadingDialogs.h
../../include/Utilities/TraceLog.h
../../include/Utilities/wxAppWithHelpers.h
../../include/Utilities/wxBaseTools.h
../../include/Utilities/wxGuiTools.h

View File

@ -39,7 +39,7 @@
#ifdef _MSC_VER
#define EXPORT_C_(type) extern "C" type CALLBACK
#else
#define EXPORT_C_(type) extern "C" type
#define EXPORT_C_(type) extern "C" __attribute__((externally_visible,visibility("default"))) type
#endif
extern const unsigned char version;

View File

@ -14,6 +14,7 @@ set(CommonFlags
)
set(OptimizationFlags
-fvisibility=hidden
-O2
-DNDEBUG
)

View File

@ -15,6 +15,7 @@ set(CommonFlags
)
set(OptimizationFlags
-fvisibility=hidden
-O2
-DNDEBUG
)

View File

@ -46,7 +46,7 @@ typedef struct _keyEvent keyEvent;
#ifdef _MSC_VER
#define EXPORT_C_(type) extern "C" type CALLBACK
#else
#define EXPORT_C_(type) extern "C" type
#define EXPORT_C_(type) extern "C" __attribute__((externally_visible,visibility("default"))) type
#endif
#define GS_LOG __Log

View File

@ -13,6 +13,7 @@ set(CommonFlags
)
set(OptimizationFlags
-fvisibility=hidden
-O2
-DNDEBUG
)

View File

@ -37,7 +37,7 @@
#ifdef _MSC_VER
#define EXPORT_C_(type) extern "C" type CALLBACK
#else
#define EXPORT_C_(type) extern "C" type
#define EXPORT_C_(type) extern "C" __attribute__((externally_visible,visibility("default"))) type
#endif
#define PAD_LOG __Log

View File

@ -14,6 +14,7 @@ set(CommonFlags
)
set(OptimizationFlags
-fvisibility=hidden
-O2
-DNDEBUG
)

View File

@ -39,7 +39,7 @@ extern "C"
#ifdef _MSC_VER
#define EXPORT_C_(type) extern "C" __declspec(dllexport) type CALLBACK
#else
#define EXPORT_C_(type) extern "C" type
#define EXPORT_C_(type) extern "C" __attribute__((externally_visible,visibility("default"))) type
#endif
extern FILE *spu2Log;

View File

@ -14,6 +14,7 @@ set(CommonFlags
)
set(OptimizationFlags
-fvisibility=hidden
-O2
-DNDEBUG
)

View File

@ -279,7 +279,7 @@ EXPORT_C_(s32) PADopen(void *pDsp)
return _PADopen(pDsp);
}
void CALLBACK PADsetSettingsDir(const char* dir)
EXPORT_C_(void) PADsetSettingsDir(const char* dir)
{
// Get the path to the ini directory.
s_strIniPath = (dir==NULL) ? "inis/" : dir;
@ -602,7 +602,7 @@ EXPORT_C_(u8) PADpoll(u8 value)
}
// PADkeyEvent is called every vsync (return NULL if no event)
keyEvent* CALLBACK PADkeyEvent()
EXPORT_C_(keyEvent*) PADkeyEvent()
{
s_event = event;
event.evt = 0;

View File

@ -53,6 +53,12 @@ using namespace std;
#include "bitwise.h"
#include "controller.h"
#ifdef _MSC_VER
#define EXPORT_C_(type) extern "C" __declspec(dllexport) type CALLBACK
#else
#define EXPORT_C_(type) extern "C" __attribute__((externally_visible,visibility("default"))) type
#endif
extern char libraryName[256];
enum PadOptions
@ -148,24 +154,5 @@ void SaveConfig();
void SysMessage(char *fmt, ...);
void UpdateKeys(int pad, int keyPress, int keyRelease);
#ifdef __cplusplus
#ifdef _MSC_VER
#define EXPORT_C_(type) extern "C" __declspec(dllexport) type CALLBACK
#else
#define EXPORT_C_(type) extern "C" type
#endif
#else
#ifdef _MSC_VER
#define EXPORT_C_(type) __declspec(dllexport) type __stdcall
#else
#define EXPORT_C_(type) type
#endif
#endif
#endif

View File

@ -15,6 +15,7 @@ set(CommonFlags
)
set(OptimizationFlags
-fvisibility=hidden
-O2
-DNDEBUG
)

View File

@ -28,7 +28,7 @@
#ifdef _MSC_VER
#define EXPORT_C_(type) extern "C" __declspec(dllexport) type CALLBACK
#else
#define EXPORT_C_(type) extern "C" type
#define EXPORT_C_(type) extern "C" __attribute__((externally_visible,visibility("default"))) type
#endif
// We have our own versions that have the DLLExport attribute configured: