* Introduce porting.h for portability define thingies.
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Sun, 10 Jun 2007 18:59:51 +0000 (20:59 +0200)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Sun, 10 Jun 2007 18:59:51 +0000 (20:59 +0200)
 * Include . in the include path for compiling.
 * Make CLog support user logging through stdout.

ABM2/Engine/Log.cpp
ABM2/Makefile
ABM2/porting.h [new file with mode: 0644]

index dce8af93633b27c02daf681a329d26f201fd2c0e..6012f9aa35e5d46b1b78f172f3df3b52b802bdc7 100755 (executable)
@@ -2,6 +2,8 @@
 //\r
 //////////////////////////////////////////////////////////////////////\r
 \r
+#include <stdarg.h>\r
+#include "porting.h"\r
 #include "engine.h"\r
 #include "Log.h"\r
 \r
@@ -71,7 +73,7 @@ void CLog::Write(int target, const char *msg, ...)
 #ifdef WIN32\r
                MessageBox(NULL,(LPCTSTR)szBuf,L"Message",MB_OK);\r
 #else\r
-#error User-level logging is not implemented for this platform.\r
+       std::cout << szBuf << "\n";\r
 #endif\r
        }\r
        va_end(args);\r
index bf2539cbfdb49d3c65e96fcd187d799c3b98f98a..a20f0604a6b34e9b2ecc165aee3678d31fc4dec8 100644 (file)
@@ -1,7 +1,10 @@
-all: main.o
+CFLAGS:=-I.
+OBJS:=main.o Engine/Log.o
+
+all: $(OBJS)
 
 %.o: %.cpp
-       g++ -c $< -o $@
+       g++ $(CFLAGS) -c $< -o $@
 
 clean:
-       rm -f *.o
+       rm -f *.o Engine/*.o
diff --git a/ABM2/porting.h b/ABM2/porting.h
new file mode 100644 (file)
index 0000000..a4f6c1f
--- /dev/null
@@ -0,0 +1,3 @@
+#ifndef WIN32
+       #define vsprintf_s vsnprintf
+#endif // !WIN32