3D model(pmd, mqo...) IO library using C++.
Revision | 984c94cd3b0a966c03bf1ff470797f7337ad5fee (tree) |
---|---|
Zeit | 2012-03-07 23:51:43 |
Autor | ousttrue <ousttrue@gmai...> |
Commiter | ousttrue |
fix for gcc-4.5 on cygwin
@@ -98,7 +98,7 @@ namespace meshio { | ||
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | -#ifdef _WIN32 | |
101 | +#ifdef _MSC_VER | |
102 | 102 | void readAll(const wchar_t *path, std::vector<char> &buf) |
103 | 103 | { |
104 | 104 | FILE* fp = _wfopen(path, L"rb"); |
@@ -115,7 +115,7 @@ namespace meshio { | ||
115 | 115 | io_=fopen(path, "wb"); |
116 | 116 | } |
117 | 117 | |
118 | -#if _WIN32 | |
118 | +#if _MSC_VER | |
119 | 119 | FileWriter::FileWriter(const wchar_t *path) |
120 | 120 | { |
121 | 121 | io_=_wfopen(path, L"wb"); |
@@ -1,6 +1,15 @@ | ||
1 | 1 | solution "meshio" |
2 | 2 | configurations { "Debug", "Release" } |
3 | 3 | |
4 | +configuration { "windows*" } | |
5 | +do | |
6 | + defines { | |
7 | + 'WIN32', | |
8 | + '_WIN32', | |
9 | + '_WINDOWS', | |
10 | + } | |
11 | +end | |
12 | + | |
4 | 13 | configuration { "vs*" } |
5 | 14 | do |
6 | 15 | buildoptions { |
@@ -1,7 +1,13 @@ | ||
1 | 1 | #ifndef MESH_IO_TEXT_H_INCLUDED |
2 | 2 | #define MESH_IO_TEXT_H_INCLUDED |
3 | 3 | |
4 | -//#include "binary.h" | |
4 | +#ifdef _WINDOWS | |
5 | +#define NOMINMAX | |
6 | +#include <windows.h> | |
7 | +#else | |
8 | +#include <iconv.h> | |
9 | +#endif | |
10 | + | |
5 | 11 | #include "la.h" |
6 | 12 | #include "color.h" |
7 | 13 | #include <string> |
@@ -10,12 +16,6 @@ | ||
10 | 16 | #include <stdlib.h> |
11 | 17 | #include <cstring> |
12 | 18 | |
13 | -#ifdef _MSC_VER | |
14 | -#include <windows.h> | |
15 | -#else | |
16 | -#include <iconv.h> | |
17 | -#endif | |
18 | - | |
19 | 19 | namespace meshio { |
20 | 20 | |
21 | 21 | class cstr |
@@ -162,7 +162,7 @@ namespace meshio { | ||
162 | 162 | } |
163 | 163 | #endif |
164 | 164 | |
165 | -#if defined(_MSC_VER) | |
165 | +#if defined(_WINDOWS) | |
166 | 166 | inline std::wstring to_WideChar(UINT uCodePage, const std::string &text) |
167 | 167 | { |
168 | 168 | int size=MultiByteToWideChar(uCodePage, 0, text.c_str(), -1, NULL, 0); |