Skip to content

Commit

Permalink
misc: prefix CALLBACK to avoid compile warnings. other cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jsm174 committed Jan 6, 2024
1 parent a5068d0 commit 51843aa
Show file tree
Hide file tree
Showing 28 changed files with 24 additions and 34 deletions.
12 changes: 6 additions & 6 deletions src/altsound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void altsound_postprocess_commands(const unsigned int combined_cmd)
* AltsoundSetLogger
******************************************************/

ALTSOUND_API void AltsoundSetLogger(const string& logPath, ALTSOUND_LOG_LEVEL logLevel, bool console)
ALTSOUNDAPI void AltsoundSetLogger(const string& logPath, ALTSOUND_LOG_LEVEL logLevel, bool console)
{
alog.setLogPath(logPath);
alog.setLogLevel((AltsoundLogger::Level)logLevel);
Expand All @@ -233,7 +233,7 @@ ALTSOUND_API void AltsoundSetLogger(const string& logPath, ALTSOUND_LOG_LEVEL lo
* AltsoundInit
******************************************************/

ALTSOUND_API bool AltsoundInit(const string& pinmamePath, const string& gameName)
ALTSOUNDAPI bool AltsoundInit(const string& pinmamePath, const string& gameName)
{
ALT_DEBUG(0, "BEGIN AltsoundInit()");
ALT_INDENT;
Expand Down Expand Up @@ -322,7 +322,7 @@ ALTSOUND_API bool AltsoundInit(const string& pinmamePath, const string& gameName
* AltsoundProcessCommand
******************************************************/

ALTSOUND_API void AltsoundSetHardwareGen(ALTSOUND_HARDWARE_GEN hardwareGen)
ALTSOUNDAPI void AltsoundSetHardwareGen(ALTSOUND_HARDWARE_GEN hardwareGen)
{
ALT_DEBUG(0, "BEGIN AltsoundSetHardwareGen()");
ALT_INDENT;
Expand All @@ -339,7 +339,7 @@ ALTSOUND_API void AltsoundSetHardwareGen(ALTSOUND_HARDWARE_GEN hardwareGen)
* AltsoundProcessCommand
******************************************************/

ALTSOUND_API bool AltsoundProcessCommand(const unsigned int cmd, int attenuation)
ALTSOUNDAPI bool AltsoundProcessCommand(const unsigned int cmd, int attenuation)
{
ALT_DEBUG(0, "BEGIN AltsoundProcessCommand()");

Expand Down Expand Up @@ -416,7 +416,7 @@ ALTSOUND_API bool AltsoundProcessCommand(const unsigned int cmd, int attenuation
* AltsoundPause
******************************************************/

ALTSOUND_API void AltsoundPause(bool pause)
ALTSOUNDAPI void AltsoundPause(bool pause)
{
ALT_DEBUG(0, "BEGIN alt_sound_pause()");
ALT_INDENT;
Expand Down Expand Up @@ -468,7 +468,7 @@ ALTSOUND_API void AltsoundPause(bool pause)
* AltsoundShutdown
******************************************************/

ALTSOUND_API void AltsoundShutdown()
ALTSOUNDAPI void AltsoundShutdown()
{
ALT_DEBUG(0, "BEGIN AltsoundShutdown()");
ALT_INDENT;
Expand Down
19 changes: 10 additions & 9 deletions src/altsound.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
#define ALTSOUND_MINOR_VERSION ALTSOUND_STR(ALTSOUND_VERSION_MAJOR) "." ALTSOUND_STR(ALTSOUND_VERSION_MINOR)

#ifdef _MSC_VER
#define ALTSOUND_API extern "C" __declspec(dllexport)
#define ALTSOUNDAPI extern "C" __declspec(dllexport)
#define ALTSOUNDCALLBACK __stdcall
#else
#define ALTSOUND_API extern "C" __attribute__((visibility("default")))
#define CALLBACK
#define ALTSOUNDAPI extern "C" __attribute__((visibility("default")))
#define ALTSOUNDCALLBACK
#endif

#include <cstdint>
Expand Down Expand Up @@ -54,9 +55,9 @@ typedef enum {
ALTSOUND_LOG_LEVEL_UNDEFINED,
} ALTSOUND_LOG_LEVEL;

ALTSOUND_API void AltsoundSetLogger(const string& logPath, ALTSOUND_LOG_LEVEL logLevel, bool console);
ALTSOUND_API bool AltsoundInit(const string& pinmamePath, const string& gameName);
ALTSOUND_API void AltsoundSetHardwareGen(ALTSOUND_HARDWARE_GEN hardwareGen);
ALTSOUND_API bool AltsoundProcessCommand(const unsigned int cmd, int attenuation);
ALTSOUND_API void AltsoundPause(bool pause);
ALTSOUND_API void AltsoundShutdown();
ALTSOUNDAPI void AltsoundSetLogger(const string& logPath, ALTSOUND_LOG_LEVEL logLevel, bool console);
ALTSOUNDAPI bool AltsoundInit(const string& pinmamePath, const string& gameName);
ALTSOUNDAPI void AltsoundSetHardwareGen(ALTSOUND_HARDWARE_GEN hardwareGen);
ALTSOUNDAPI bool AltsoundProcessCommand(const unsigned int cmd, int attenuation);
ALTSOUNDAPI void AltsoundPause(bool pause);
ALTSOUNDAPI void AltsoundShutdown();
6 changes: 3 additions & 3 deletions src/altsound_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ bool AltsoundProcessor::stopJingleStream()

// ---------------------------------------------------------------------------

void CALLBACK AltsoundProcessor::jingle_callback(HSYNC handle, DWORD channel,\
void ALTSOUNDCALLBACK AltsoundProcessor::jingle_callback(HSYNC handle, DWORD channel,\
DWORD data, void* user)
{
// All SYNCPROC functions run on the same thread, and will block other
Expand Down Expand Up @@ -619,7 +619,7 @@ void CALLBACK AltsoundProcessor::jingle_callback(HSYNC handle, DWORD channel,\

// ---------------------------------------------------------------------------

void CALLBACK AltsoundProcessor::sfx_callback(HSYNC handle, DWORD channel,\
void ALTSOUNDCALLBACK AltsoundProcessor::sfx_callback(HSYNC handle, DWORD channel,\
DWORD data, void *user)
{
// All SYNCPROC functions run on the same thread, and will block other
Expand Down Expand Up @@ -678,7 +678,7 @@ void CALLBACK AltsoundProcessor::sfx_callback(HSYNC handle, DWORD channel,\

// ---------------------------------------------------------------------------

void CALLBACK AltsoundProcessor::music_callback(HSYNC handle, DWORD channel,\
void ALTSOUNDCALLBACK AltsoundProcessor::music_callback(HSYNC handle, DWORD channel,\
DWORD data, void *user)
{
// All SYNCPROC functions run on the same thread, and will block other
Expand Down
6 changes: 3 additions & 3 deletions src/altsound_processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ class AltsoundProcessor final : public AltsoundProcessorBase
bool process_sfx(AltsoundStreamInfo* stream_out);

// BASS SYNCPROC callback when jingle samples end
static void CALLBACK jingle_callback(HSYNC handle, DWORD channel, DWORD data, void *user);
static void ALTSOUNDCALLBACK jingle_callback(HSYNC handle, DWORD channel, DWORD data, void *user);

// BASS SYNCPROC callback when sfx samples end
static void CALLBACK sfx_callback(HSYNC handle, DWORD channel, DWORD data, void *user);
static void ALTSOUNDCALLBACK sfx_callback(HSYNC handle, DWORD channel, DWORD data, void *user);

// BASS SYNCPROC callback when music samples end
static void CALLBACK music_callback(HSYNC handle, DWORD channel, DWORD data, void *user);
static void ALTSOUNDCALLBACK music_callback(HSYNC handle, DWORD channel, DWORD data, void *user);

private: // data

Expand Down
2 changes: 1 addition & 1 deletion src/gsound_processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ bool GSoundProcessor::stopExclusiveStream(const AltsoundSampleType stream_type)

// ----------------------------------------------------------------------------

void CALLBACK GSoundProcessor::common_callback(HSYNC handle, DWORD channel, DWORD data, void* user)
void ALTSOUNDCALLBACK GSoundProcessor::common_callback(HSYNC handle, DWORD channel, DWORD data, void* user)
{
ALT_DEBUG(0, "\nBEGIN: GSoundProcessor::common_callback()");
ALT_INDENT;
Expand Down
2 changes: 1 addition & 1 deletion src/gsound_processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class GSoundProcessor final : public AltsoundProcessorBase
bool stopExclusiveStream(const AltsoundSampleType stream_type);

// BASS SYNCPROC callback whan a stream ends
static void CALLBACK common_callback(HSYNC handle, DWORD channel, DWORD data, void* user);
static void ALTSOUNDCALLBACK common_callback(HSYNC handle, DWORD channel, DWORD data, void* user);

// adjust volume of active streams to accommodate current ducking impacts
static bool adjustStreamVolumes();
Expand Down
Empty file.
1 change: 0 additions & 1 deletion third-party/build-libs/win/x64/README.md

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion third-party/build-libs/win/x86/README.md

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion third-party/runtime-libs/android/arm64-v8a/README.md

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion third-party/runtime-libs/ios/arm64/frameworks/README.md

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion third-party/runtime-libs/linux/aarch64/README.md

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion third-party/runtime-libs/linux/x64/README.md

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion third-party/runtime-libs/macos/arm64/README.md

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion third-party/runtime-libs/macos/x64/README.md

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion third-party/runtime-libs/tvos/arm64/frameworks/README.md

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion third-party/runtime-libs/win/x64/README.md

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion third-party/runtime-libs/win/x86/README.md

This file was deleted.

0 comments on commit 51843aa

Please sign in to comment.