Skip to content

Commit 9fc8ec5

Browse files
committed
Merge branch 'tbeu-fix-bool-and-inline-for-C-compilation-with-MSVC'
2 parents f185284 + 751a6f9 commit 9fc8ec5

File tree

5 files changed

+15
-85
lines changed

5 files changed

+15
-85
lines changed

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ IF (MSGPACK_ENABLE_CXX)
9999
)
100100
ENDIF ()
101101

102-
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
103-
SET_SOURCE_FILES_PROPERTIES(${msgpack_SOURCES} PROPERTIES LANGUAGE CXX)
104-
ENDIF ()
105-
106102
EXECUTE_PROCESS (
107103
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/src/msgpack
108104
)

msgpack_vc8.vcproj

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -159,102 +159,22 @@
159159
<File
160160
RelativePath=".\src\objectc.c"
161161
>
162-
<FileConfiguration
163-
Name="Debug|Win32"
164-
>
165-
<Tool
166-
Name="VCCLCompilerTool"
167-
CompileAs="2"
168-
/>
169-
</FileConfiguration>
170-
<FileConfiguration
171-
Name="Release|Win32"
172-
>
173-
<Tool
174-
Name="VCCLCompilerTool"
175-
CompileAs="2"
176-
/>
177-
</FileConfiguration>
178162
</File>
179163
<File
180164
RelativePath=".\src\unpack.c"
181165
>
182-
<FileConfiguration
183-
Name="Debug|Win32"
184-
>
185-
<Tool
186-
Name="VCCLCompilerTool"
187-
CompileAs="2"
188-
/>
189-
</FileConfiguration>
190-
<FileConfiguration
191-
Name="Release|Win32"
192-
>
193-
<Tool
194-
Name="VCCLCompilerTool"
195-
CompileAs="2"
196-
/>
197-
</FileConfiguration>
198166
</File>
199167
<File
200168
RelativePath=".\src\version.c"
201169
>
202-
<FileConfiguration
203-
Name="Debug|Win32"
204-
>
205-
<Tool
206-
Name="VCCLCompilerTool"
207-
CompileAs="2"
208-
/>
209-
</FileConfiguration>
210-
<FileConfiguration
211-
Name="Release|Win32"
212-
>
213-
<Tool
214-
Name="VCCLCompilerTool"
215-
CompileAs="2"
216-
/>
217-
</FileConfiguration>
218170
</File>
219171
<File
220172
RelativePath=".\src\vrefbuffer.c"
221173
>
222-
<FileConfiguration
223-
Name="Debug|Win32"
224-
>
225-
<Tool
226-
Name="VCCLCompilerTool"
227-
CompileAs="2"
228-
/>
229-
</FileConfiguration>
230-
<FileConfiguration
231-
Name="Release|Win32"
232-
>
233-
<Tool
234-
Name="VCCLCompilerTool"
235-
CompileAs="2"
236-
/>
237-
</FileConfiguration>
238174
</File>
239175
<File
240176
RelativePath=".\src\zone.c"
241177
>
242-
<FileConfiguration
243-
Name="Debug|Win32"
244-
>
245-
<Tool
246-
Name="VCCLCompilerTool"
247-
CompileAs="2"
248-
/>
249-
</FileConfiguration>
250-
<FileConfiguration
251-
Name="Release|Win32"
252-
>
253-
<Tool
254-
Name="VCCLCompilerTool"
255-
CompileAs="2"
256-
/>
257-
</FileConfiguration>
258178
</File>
259179
<File
260180
RelativePath=".\src\object.cpp"

src/msgpack.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @{
2121
* @}
2222
*/
23+
2324
#include "msgpack/object.h"
2425
#include "msgpack/zone.h"
2526
#include "msgpack/pack.h"

src/msgpack/sysdep.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,5 +191,18 @@ typedef unsigned int _msgpack_atomic_counter_t;
191191
*/
192192

193193

194+
#if !defined(__cplusplus) && defined(_MSC_VER)
195+
#if !defined(FALSE)
196+
#define FALSE (0)
197+
#endif
198+
#if !defined(TRUE)
199+
#define TRUE (!FALSE)
200+
#endif
201+
#define bool int
202+
#define true TRUE
203+
#define false FALSE
204+
#define inline __inline
205+
#endif
206+
194207
#endif /* msgpack/sysdep.h */
195208

src/unpack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static int template_execute(template_context* ctx,
5656

5757

5858
static inline msgpack_object template_callback_root(unpack_user* u)
59-
{ msgpack_object o = {}; return o; }
59+
{ msgpack_object o = { MSGPACK_OBJECT_NIL }; return o; }
6060

6161
static inline int template_callback_uint8(unpack_user* u, uint8_t d, msgpack_object* o)
6262
{ o->type = MSGPACK_OBJECT_POSITIVE_INTEGER; o->via.u64 = d; return 0; }

0 commit comments

Comments
 (0)