• R/O
  • HTTP
  • SSH
  • HTTPS

meshio: Commit

3D model(pmd, mqo...) IO library using C++.


Commit MetaInfo

Revision984c94cd3b0a966c03bf1ff470797f7337ad5fee (tree)
Time2012-03-07 23:51:43
Authorousttrue <ousttrue@gmai...>
Commiterousttrue

Log Message

fix for gcc-4.5 on cygwin

Change Summary

Incremental Difference

--- a/src/binary.cpp
+++ b/src/binary.cpp
@@ -98,7 +98,7 @@ namespace meshio {
9898 }
9999 }
100100
101-#ifdef _WIN32
101+#ifdef _MSC_VER
102102 void readAll(const wchar_t *path, std::vector<char> &buf)
103103 {
104104 FILE* fp = _wfopen(path, L"rb");
@@ -115,7 +115,7 @@ namespace meshio {
115115 io_=fopen(path, "wb");
116116 }
117117
118-#if _WIN32
118+#if _MSC_VER
119119 FileWriter::FileWriter(const wchar_t *path)
120120 {
121121 io_=_wfopen(path, L"wb");
--- a/src/premake4.lua
+++ b/src/premake4.lua
@@ -1,6 +1,15 @@
11 solution "meshio"
22 configurations { "Debug", "Release" }
33
4+configuration { "windows*" }
5+do
6+ defines {
7+ 'WIN32',
8+ '_WIN32',
9+ '_WINDOWS',
10+ }
11+end
12+
413 configuration { "vs*" }
514 do
615 buildoptions {
--- a/src/text.h
+++ b/src/text.h
@@ -1,7 +1,13 @@
11 #ifndef MESH_IO_TEXT_H_INCLUDED
22 #define MESH_IO_TEXT_H_INCLUDED
33
4-//#include "binary.h"
4+#ifdef _WINDOWS
5+#define NOMINMAX
6+#include <windows.h>
7+#else
8+#include <iconv.h>
9+#endif
10+
511 #include "la.h"
612 #include "color.h"
713 #include <string>
@@ -10,12 +16,6 @@
1016 #include <stdlib.h>
1117 #include <cstring>
1218
13-#ifdef _MSC_VER
14-#include <windows.h>
15-#else
16-#include <iconv.h>
17-#endif
18-
1919 namespace meshio {
2020
2121 class cstr
@@ -162,7 +162,7 @@ namespace meshio {
162162 }
163163 #endif
164164
165-#if defined(_MSC_VER)
165+#if defined(_WINDOWS)
166166 inline std::wstring to_WideChar(UINT uCodePage, const std::string &text)
167167 {
168168 int size=MultiByteToWideChar(uCodePage, 0, text.c_str(), -1, NULL, 0);
Show on old repository browser