]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/string/string.h
Centralise compile checks
[xonotic/netradiant.git] / libs / string / string.h
index c9ef2c4dbb46fb0a404145585b0bbce75c39d518..ff7dc4536c9245ce116e612534f0d1ff826a49a6 100644 (file)
@@ -22,6 +22,8 @@
 #if !defined( INCLUDED_STRING_STRING_H )
 #define INCLUDED_STRING_STRING_H
 
+#include "globaldefs.h"
+
 /// \file
 /// C-style null-terminated-character-array string library.
 
@@ -81,7 +83,7 @@ inline bool string_greater( const char* string, const char* other ){
 /// Returns 0 if \p string is lexicographically equal to \p other after converting both to lower-case.
 /// O(n)
 inline int string_compare_nocase( const char* string, const char* other ){
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
        return _stricmp( string, other );
 #else
        return strcasecmp( string, other );
@@ -94,7 +96,7 @@ inline int string_compare_nocase( const char* string, const char* other ){
 /// Treats all ascii characters as lower-case during comparisons.
 /// O(n)
 inline int string_compare_nocase_n( const char* string, const char* other, std::size_t n ){
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
        return _strnicmp( string, other, n );
 #else
        return strncasecmp( string, other, n );