Skip to content

Commit 061f45d

Browse files
committed
add new C api function ModPlug_GetVersion, add version macros to modplug.h
1 parent d7ba5ef commit 061f45d

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/modplug.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ namespace ModPlug
8181
}
8282
}
8383

84+
long ModPlug_GetVersion(void)
85+
{
86+
return LIBMODPLUG_VERSION;
87+
}
88+
8489
ModPlugFile* ModPlug_Load(const void* data, int size)
8590
{
8691
ModPlugFile* result = new ModPlugFile;

src/modplug.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
extern "C" {
1212
#endif
1313

14+
#define LIBMODPLUG_MAJOR 0L
15+
#define LIBMODPLUG_MINOR 8L
16+
#define LIBMODPLUG_REVISION 9L
17+
#define LIBMODPLUG_PATCH 0L
18+
#define LIBMODPLUG_VERSION \
19+
((LIBMODPLUG_MAJOR <<24) | \
20+
(LIBMODPLUG_MINOR <<16) | \
21+
(LIBMODPLUG_REVISION<< 8) | \
22+
(LIBMODPLUG_PATCH))
23+
1424
#if defined(_WIN32) || defined(__CYGWIN__)
1525
# if defined(MODPLUG_BUILD) && defined(DLL_EXPORT) /* building libmodplug as a dll for windows */
1626
# define MODPLUG_EXPORT __declspec(dllexport)
@@ -25,6 +35,8 @@ extern "C" {
2535
#define MODPLUG_EXPORT
2636
#endif
2737

38+
MODPLUG_EXPORT long ModPlug_GetVersion(void);
39+
2840
struct _ModPlugFile;
2941
typedef struct _ModPlugFile ModPlugFile;
3042

0 commit comments

Comments
 (0)