aboutsummaryrefslogtreecommitdiff
path: root/utils/dumpbank
diff options
context:
space:
mode:
authorWohlstand <admin@wohlnet.ru>2017-11-12 07:32:11 +0300
committerWohlstand <admin@wohlnet.ru>2017-11-12 07:32:11 +0300
commitb043032a89f38e2b3191a65dab9ae4e8202d48f3 (patch)
treefa43cf8e88087b84aff825e8eaac40ff4587f2c3 /utils/dumpbank
parentcc2d7237cce71482c04895e5550609534e41413b (diff)
downloadlibADLMIDI-b043032a89f38e2b3191a65dab9ae4e8202d48f3.tar.gz
libADLMIDI-b043032a89f38e2b3191a65dab9ae4e8202d48f3.tar.bz2
libADLMIDI-b043032a89f38e2b3191a65dab9ae4e8202d48f3.zip
libADLMIDI now is buildable under OpenWatcom except of some workarounds
- Need a different way to create a static library, otherwise it don't wanna be built. - Needed a different custom STL containers (std::vector and std::set) implementation that will work and will don't glitch with a crashes
Diffstat (limited to 'utils/dumpbank')
-rw-r--r--utils/dumpbank/dumpbank.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/utils/dumpbank/dumpbank.cpp b/utils/dumpbank/dumpbank.cpp
index aad3e7b..84283e7 100644
--- a/utils/dumpbank/dumpbank.cpp
+++ b/utils/dumpbank/dumpbank.cpp
@@ -4,14 +4,15 @@
#include <cstdio>
#include <vector>
#include <cstring>
+#include <stdio.h>
-#ifndef _MSC_VER
+#if !defined(_MSC_VER) && !defined(__WATCOMC__)
#define PACKED_STRUCT __attribute__((packed))
#else
#define PACKED_STRUCT
#endif
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__WATCOMC__)
#pragma pack(push,1)
#endif
@@ -83,7 +84,7 @@ struct BNK2_instrument
unsigned char xxxxxxxx;
} PACKED_STRUCT; // Ad Lib Gold instrument maker bankfile patch
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__WATCOMC__)
#pragma pack(pop)
#endif
@@ -157,7 +158,7 @@ static void LoadBNK2(const std::vector<unsigned char>& data)
static void LoadBNK(const char* fn)
{
- FILE* fp = fopen(fn, "rb");
+ FILE* fp = std::fopen(fn, "rb");
if(!fp)
{
std::fprintf(stderr, "ERROR: Can't open %s file!", fn);