ref: 07787fb0eb2473c7bc7e7185d37936c1b78e424b
parent: a17f9925e5b2e4b5fc20108723374c142e942bbe
author: Chris Moeller <kode54@gmail.com>
date: Sat Dec 22 13:41:25 EST 2012
Portability fixes
--- a/dumb/prj/dumb/dumb.pro
+++ b/dumb/prj/dumb/dumb.pro
@@ -10,6 +10,8 @@
TEMPLATE = lib
CONFIG += staticlib
+DEFINES += _USE_SSE
+
INCLUDEPATH += ../../include
SOURCES += \
@@ -91,7 +93,11 @@
../../src/it/itorder.c \
../../src/it/itmisc.c \
../../src/it/itload2.c \
- ../../src/it/itload.c
+ ../../src/it/itload.c \
+ ../../src/it/readany.c \
+ ../../src/it/loadany2.c \
+ ../../src/it/loadany.c \
+ ../../src/it/readany2.c
HEADERS += \
../../include/dumb.h \
--- a/dumb/src/it/itread.c
+++ b/dumb/src/it/itread.c
@@ -23,6 +23,9 @@
#include "dumb.h"
#include "internal/it.h"
+#ifndef min
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#endif
#define INVESTIGATE_OLD_INSTRUMENTS
--- a/dumb/src/it/readpsm.c
+++ b/dumb/src/it/readpsm.c
@@ -23,6 +23,10 @@
#include "dumb.h"
#include "internal/it.h"
+#ifndef min
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+
#define PSMV_OLD 940730
#define PSMV_NEW 940902
@@ -1264,7 +1268,8 @@
if ( ver )
{
tag[2][0] = "FORMATVERSION";
- itoa(ver, version, 10);
+ snprintf( version, 15, "%u", ver );
+ version[15] = 0;
tag[2][1] = (const char *) &version;
++n_tags;
}
--- a/dumb/src/it/readstm.c
+++ b/dumb/src/it/readstm.c
@@ -25,6 +25,10 @@
#include "dumb.h"
#include "internal/it.h"
+#ifndef _MSC_VER
+#define strnicmp strncasecmp
+#endif
+
/** WARNING: this is duplicated in itread.c */
static int it_seek(DUMBFILE *f, long offset)
{