summaryrefslogtreecommitdiffhomepage
path: root/FoundationEx/Text.h
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-03-27 22:40:16 +0200
committerAki <please@ignore.pl>2022-03-27 22:40:16 +0200
commita8c5ec05320d58347ed434964e05818b082f00b4 (patch)
tree27fdd593b874f00a3d95349ee588e115c74a4cc7 /FoundationEx/Text.h
parent1cf689a6ad9d6c5cd29e11a6a96cb075eb2bbbb8 (diff)
downloadstarshatter-a8c5ec05320d58347ed434964e05818b082f00b4.zip
starshatter-a8c5ec05320d58347ed434964e05818b082f00b4.tar.gz
starshatter-a8c5ec05320d58347ed434964e05818b082f00b4.tar.bz2
Moved FoundationEx closer to c++ standard
It now builds with gcc on Linux
Diffstat (limited to 'FoundationEx/Text.h')
-rw-r--r--FoundationEx/Text.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/FoundationEx/Text.h b/FoundationEx/Text.h
index 0ade946..736c6b9 100644
--- a/FoundationEx/Text.h
+++ b/FoundationEx/Text.h
@@ -15,10 +15,12 @@
#define Text_h
#include <atomic>
+#include <cstring>
#include <ostream>
-#include <string.h>
-#include <windows.h>
+#ifndef _WIN32
+#include <strings.h>
+#endif
// +-------------------------------------------------------------------+
@@ -138,7 +140,11 @@ inline int Text::compare(const char* s) const
if (rep->sensitive)
return strcmp(sym, s);
else
+#ifdef _WIN32
return _stricmp(sym, s);
+#else
+ return strcasecmp(sym, s);
+#endif
}
inline int Text::compare(const Text& s) const
@@ -146,7 +152,11 @@ inline int Text::compare(const Text& s) const
if (rep->sensitive && s.rep->sensitive)
return strcmp(sym, s.sym);
else
+#ifdef _WIN32
return _stricmp(sym, s.sym);
+#else
+ return strcasecmp(sym, s.sym);
+#endif
}
// +-------------------------------------------------------------------+