mirror of
https://github.com/RPCS3/soundtouch.git
synced 2024-11-27 21:30:25 +00:00
GNU compilation of SoundTouchDll that has easy function importing interfaces for java, mono etc
This commit is contained in:
parent
05a3403137
commit
407f516e0d
@ -34,10 +34,32 @@
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
#include <windows.h>
|
||||
|
||||
// DLL main in Windows compilation
|
||||
BOOL APIENTRY DllMain( HANDLE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#include "SoundTouchDLL.h"
|
||||
#include "soundtouch.h"
|
||||
#include "SoundTouch.h"
|
||||
|
||||
using namespace soundtouch;
|
||||
|
||||
@ -45,24 +67,6 @@ using namespace soundtouch;
|
||||
#error "error - compile the dll version with float samples"
|
||||
#endif // SOUNDTOUCH_INTEGER_SAMPLES
|
||||
|
||||
|
||||
BOOL APIENTRY DllMain( HANDLE hModule,
|
||||
DWORD ul_reason_for_call,
|
||||
LPVOID lpReserved
|
||||
)
|
||||
{
|
||||
switch (ul_reason_for_call)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
case DLL_THREAD_ATTACH:
|
||||
case DLL_THREAD_DETACH:
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//////////////
|
||||
|
||||
typedef struct
|
||||
|
@ -37,24 +37,37 @@
|
||||
#ifndef _SoundTouchDLL_h_
|
||||
#define _SoundTouchDLL_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
// Windows
|
||||
#ifndef __cplusplus
|
||||
#error "Expected g++"
|
||||
#endif
|
||||
|
||||
#ifdef DLL_EXPORTS
|
||||
#define SOUNDTOUCHDLL_API extern "C" __declspec(dllexport)
|
||||
#else
|
||||
#define SOUNDTOUCHDLL_API extern "C" __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#ifdef DLL_EXPORTS
|
||||
#define SOUNDTOUCHDLL_API extern "C" __declspec(dllexport)
|
||||
#else
|
||||
#define SOUNDTOUCHDLL_API extern "C" __declspec(dllimport)
|
||||
// GNU version
|
||||
|
||||
#ifdef DLL_EXPORTS
|
||||
// GCC declaration for exporting functions
|
||||
#define SOUNDTOUCHDLL_API extern "C" __attribute__((__visibility__("default")))
|
||||
#else
|
||||
// GCC doesn't require DLL imports
|
||||
#define SOUNDTOUCHDLL_API
|
||||
#endif
|
||||
|
||||
// Linux-replacements for Windows declarations:
|
||||
#define __cdecl
|
||||
typedef unsigned int DWORD;
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifdef DLL_EXPORTS
|
||||
#define SOUNDTOUCHDLL_API __declspec(dllexport)
|
||||
#else
|
||||
#define SOUNDTOUCHDLL_API __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef void * HANDLE;
|
||||
|
||||
/// Create a new instance of SoundTouch processor.
|
||||
|
8
source/SoundTouchDLL/make-gnu-dll.sh
Executable file
8
source/SoundTouchDLL/make-gnu-dll.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script compiles SoundTouch dynamic-link library for GNU environment
|
||||
# with wrapper functions that are easier to import to Java / Mono / etc
|
||||
#
|
||||
|
||||
g++ -fPIC -shared -DDLL_EXPORTS -fvisibility=hidden -I../../include -o SoundTouchDll.so \
|
||||
SoundTouchDLL.cpp ../SoundTouch/*.cpp -I../SoundTouch -O3 -msse
|
Loading…
Reference in New Issue
Block a user