Commits

Anton Golov committed 10d5939

Made everything build here.

Comments (0)

Files changed (2)

src/clReflectTest/Main.cpp

 
 int main()
 {
+	// TODO: This file is only created on Windows, so we'll have to figure out
+	// what to do on Linux.
 #ifdef _DEBUG
 	StdFile file("../../build/bin/Debug/clReflectTest.cppbin");
 #else
 	TestTypedefsFunc(db);
 
 	return 0;
-}
+}

src/clReflectUtil/SerialiseJSON.cpp

 #define SAVE_POINTER_HASH_AS_HEX
 
 
-// Explicitly stated dependencies in stdlib.h
-extern "C" double strtod(const char* s00, char** se);
+#ifdef __GNUC__
+#include <cstdio>
+#include <cstring>
+
+using std::strlen;
+using std::snprintf;
+
+#elif defined(_WIN32)
 // This is Microsoft's safer version of the ISO C++ _fcvt which takes the extra buffer and size parameters
 // for overflow checking and thread safety
 extern "C" int _fcvt_s(char* buffer, unsigned int buffer_size, double val, int count, int* dec, int* sign);
+#endif
+// Explicitly stated dependencies in stdlib.h
+extern "C" double strtod(const char* s00, char** se);
 
 
 static void SetupTypeDispatchLUT();
 		}
 
 		// Convert the double to a string on the local stack
+		char decimal_buffer[512];
+#ifdef _WIN32
 		char fcvt_buffer[512] = { 0 };
 		int dec = -1, sign = -1;
-#ifdef _WIN32
 		_fcvt_s(fcvt_buffer, sizeof(fcvt_buffer), decimal, 48, &dec, &sign);
-#else
-		v
-#endif
 
-		char decimal_buffer[512];
 		char* iptr = fcvt_buffer;
 		char* optr = decimal_buffer;
 
 
 		*(last_nonzero_digit + 1) = 0;
 		out.Write(decimal_buffer, last_nonzero_digit - decimal_buffer + 1);
+#else
+		snprintf(decimal_buffer, sizeof(decimal_buffer), "%f", decimal);
+		out.Write(decimal_buffer, strlen(decimal_buffer));
+#endif
 	}