Merge pull request #542 from syoyo/copilot/sub-pr-537-one-more-time

Guard TINYGLTF3_IMPLEMENTATION against C translation units
This commit is contained in:
Syoyo Fujita
2026-03-21 06:37:42 +09:00
committed by GitHub

View File

@@ -47,7 +47,7 @@
* Section 2: Configuration Macros
* ====================================================================== */
/* Build mode: define in ONE .c/.cpp translation unit */
/* Build mode: define in ONE C++ translation unit (.cpp) */
/* #define TINYGLTF3_IMPLEMENTATION */
/* Opt-in features (OFF by default) */
@@ -1221,17 +1221,19 @@ ParseGenerator tg3_parse_coro(
#ifdef TINYGLTF3_IMPLEMENTATION
#if !defined(__cplusplus)
#error "TINYGLTF3_IMPLEMENTATION requires a C++ translation unit (compile as .cpp)"
#endif
/* Include JSON parser */
#include "tinygltf_json.h"
#include <stdio.h>
#include <math.h>
#ifdef __cplusplus
/* Implementation uses C++ features from tinygltf_json.h */
#include <string>
#include <algorithm>
#endif
/* Forward SIMD macros to tinygltf_json.h */
#ifdef TINYGLTF3_JSON_SIMD_SSE2