aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Novichkov <admin@wohlnet.ru>2018-01-21 06:49:51 +0300
committerVitaly Novichkov <admin@wohlnet.ru>2018-01-21 06:49:51 +0300
commit37fe0cba52ce49977839eb7703ce6d7a42239a06 (patch)
tree59b328f13aa3ee6f9077a4e35f42ae913ded19e0
parentf525f430c5261f33a064458477bdf6611344799d (diff)
downloadlibADLMIDI-37fe0cba52ce49977839eb7703ce6d7a42239a06.tar.gz
libADLMIDI-37fe0cba52ce49977839eb7703ce6d7a42239a06.tar.bz2
libADLMIDI-37fe0cba52ce49977839eb7703ce6d7a42239a06.zip
Move version number into the public header
-rw-r--r--include/adlmidi.h20
-rw-r--r--src/adlmidi.cpp9
-rw-r--r--src/adlmidi_private.hpp4
3 files changed, 29 insertions, 4 deletions
diff --git a/include/adlmidi.h b/include/adlmidi.h
index 25691da..e3554a1 100644
--- a/include/adlmidi.h
+++ b/include/adlmidi.h
@@ -28,6 +28,17 @@
extern "C" {
#endif
+#define ADLMIDI_VERSION_MAJOR 1
+#define ADLMIDI_VERSION_MINOR 3
+#define ADLMIDI_VERSION_PATCHLEVEL 1
+
+#define ADLMIDI_TOSTR(s) #s
+#define ADLMIDI_VERSION \
+ ADLMIDI_TOSTR(OPNMIDI_VERSION_MAJOR) "." \
+ ADLMIDI_TOSTR(OPNMIDI_VERSION_MINOR) "." \
+ ADLMIDI_TOSTR(OPNMIDI_VERSION_PATCHLEVEL)
+
+
#include <stddef.h>
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
@@ -117,9 +128,18 @@ extern int adl_openBankData(struct ADL_MIDIPlayer *device, const void *mem, unsi
/*Returns name of currently used OPL3 emulator*/
extern const char *adl_emulatorName();
+typedef struct {
+ ADL_UInt16 major;
+ ADL_UInt16 minor;
+ ADL_UInt16 patch;
+} ADL_Version;
+
/*Returns string which contains a version number*/
extern const char *adl_linkedLibraryVersion();
+/*Returns structure which contains a version number of library */
+extern const ADL_Version *adl_linkedVersion();
+
/*Returns string which contains last error message of initialization*/
extern const char *adl_errorString();
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp
index c45e4eb..bab8750 100644
--- a/src/adlmidi.cpp
+++ b/src/adlmidi.cpp
@@ -31,6 +31,11 @@
#define MaxCards_STR "100"
#endif
+static ADL_Version adl_version = {
+ ADLMIDI_VERSION_MAJOR,
+ ADLMIDI_VERSION_MINOR,
+ ADLMIDI_VERSION_PATCHLEVEL
+};
/*---------------------------EXPORTS---------------------------*/
@@ -316,6 +321,10 @@ ADLMIDI_EXPORT const char *adl_linkedLibraryVersion()
return ADLMIDI_VERSION;
}
+ADLMIDI_EXPORT const ADL_Version *adl_linkedVersion()
+{
+ return &adl_version;
+}
ADLMIDI_EXPORT const char *adl_errorString()
{
diff --git a/src/adlmidi_private.hpp b/src/adlmidi_private.hpp
index 8b3c3a2..6dda27c 100644
--- a/src/adlmidi_private.hpp
+++ b/src/adlmidi_private.hpp
@@ -24,10 +24,6 @@
#ifndef ADLMIDI_PRIVATE_HPP
#define ADLMIDI_PRIVATE_HPP
-#ifndef ADLMIDI_VERSION
-#define ADLMIDI_VERSION "1.3.1"
-#endif
-
// Setup compiler defines useful for exporting required public API symbols in gme.cpp
#ifndef ADLMIDI_EXPORT
# if defined (_WIN32) && defined(ADLMIDI_BUILD_DLL)