X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=libs%2Fstr.h;h=e7ef600efada9c9d23cbeca5ae5d94154f1d979b;hb=7e8f20bf007190a80b919a13aee8fa1bfa9dc509;hp=9090bf2d6e4587b797c1fbfa7a87d8a0fc63e1b3;hpb=b7e36c120eb1546a6c6f97f30e42ab7f9a559c61;p=xonotic%2Fnetradiant.git diff --git a/libs/str.h b/libs/str.h index 9090bf2d..e7ef600e 100644 --- a/libs/str.h +++ b/libs/str.h @@ -31,6 +31,8 @@ #ifndef __STR__ #define __STR__ +#include "globaldefs.h" + // // class Str // loose replacement for CString from MFC @@ -44,7 +46,7 @@ #include -#ifdef _MSC_VER +#if GDEF_COMPILER_MSVC #define strcasecmp strcmpi #if _MSC_VER < 1400 #define vsnprintf std::vsnprintf @@ -67,7 +69,7 @@ inline char* Q_StrDup( const char* pStr ){ return strcpy( new char[strlen( pStr ) + 1], pStr ); } -#if !defined( WIN32 ) +#if !GDEF_OS_WINDOWS #define strcmpi strcasecmp #define stricmp strcasecmp #define strnicmp strncasecmp @@ -254,7 +256,6 @@ const char* Left( std::size_t n ){ } else { - g_pStrWork = ""; g_pStrWork = new char[1]; g_pStrWork[0] = '\0'; } @@ -290,7 +291,6 @@ const char* Mid( std::size_t first, std::size_t n ) const { } else { - g_pStrWork = ""; g_pStrWork = new char[1]; g_pStrWork[0] = '\0'; } @@ -429,7 +429,7 @@ bool operator >( char* pStr ) const { return ( m_bIgnoreCase ) ? stricmp( m_pStr bool operator >( const char* pStr ) const { return ( m_bIgnoreCase ) ? stricmp( m_pStr, pStr ) > 0 : strcmp( m_pStr, pStr ) > 0; } char& operator []( std::size_t nIndex ) { return m_pStr[nIndex]; } const char& operator []( std::size_t nIndex ) const { return m_pStr[nIndex]; } -const char GetAt( std::size_t nIndex ) { return m_pStr[nIndex]; } +char GetAt( std::size_t nIndex ) { return m_pStr[nIndex]; } };