]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/stringio.h
Partial OSX support
[xonotic/netradiant.git] / libs / stringio.h
index ff1a3a67a1300f58ff4b7cefdd7dc01c26b069e2..85d598f34f4e85da28b6a1670c080ff15cd0e66e 100644 (file)
@@ -22,7 +22,7 @@
 #if !defined ( INCLUDED_STRINGIO_H )
 #define INCLUDED_STRINGIO_H
 
-#include <stdlib.h>
+#include <cstdlib>
 #include <cctype>
 
 #include "generic/vector.h"
@@ -219,7 +219,7 @@ inline bool string_parse_size( const char* string, std::size_t& i ){
 }
 
 
-#define RETURN_FALSE_IF_FAIL( expression ) if ( !expression ) {return false; }else
+#define RETURN_FALSE_IF_FAIL( expression ) if ( !expression ) {return false; }
 
 inline void Tokeniser_unexpectedError( Tokeniser& tokeniser, const char* token, const char* expected ){
        globalErrorStream() << Unsigned( tokeniser.getLine() ) << ":" << Unsigned( tokeniser.getColumn() ) << ": parse error at '" << ( token != 0 ? token : "#EOF" ) << "': expected '" << expected << "'\n";
@@ -289,14 +289,14 @@ inline TextOutputStreamType& ostream_write( TextOutputStreamType& outputStream,
 
 
 
-inline void CopiedString_importString( CopiedString& self, const char* string ){
+inline void CopiedString_importString( std::string& self, const char* string ){
        self = string;
 }
-typedef ReferenceCaller1<CopiedString, const char*, CopiedString_importString> CopiedStringImportStringCaller;
-inline void CopiedString_exportString( const CopiedString& self, const StringImportCallback& importer ){
+typedef ReferenceCaller1<std::string, const char*, CopiedString_importString> CopiedStringImportStringCaller;
+inline void CopiedString_exportString( const std::string& self, const StringImportCallback& importer ){
        importer( self.c_str() );
 }
-typedef ConstReferenceCaller1<CopiedString, const StringImportCallback&, CopiedString_exportString> CopiedStringExportStringCaller;
+typedef ConstReferenceCaller1<std::string, const StringImportCallback&, CopiedString_exportString> CopiedStringExportStringCaller;
 
 inline void Bool_importString( bool& self, const char* string ){
        self = string_equal( string, "true" );