From 39dbdc57ded10afe7f2e49ea86e410cb65e47f8a Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sat, 29 Jun 2024 10:59:57 -0700 Subject: [PATCH] Allow overriding MESHOPTIMIZER_EXPERIMENTAL externally Similarly to MESHOPTIMIZER_API, we now define MESHOPTIMIZER_EXPERIMENTAL only if an existing definition is absent. This allows, for example, setting this to a deprecated attribute which still compiles the library itself cleanly, but will warn for any use of experimental APIs for dependent code. Another interesting use case is building .so where the experimental symbols are not exported, which usually results in an ABI stable interface. --- src/meshoptimizer.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/meshoptimizer.h b/src/meshoptimizer.h index 6c8dcd7e..cb3745a2 100644 --- a/src/meshoptimizer.h +++ b/src/meshoptimizer.h @@ -29,7 +29,9 @@ #endif /* Experimental APIs have unstable interface and might have implementation that's not fully tested or optimized */ +#ifndef MESHOPTIMIZER_EXPERIMENTAL #define MESHOPTIMIZER_EXPERIMENTAL MESHOPTIMIZER_API +#endif /* C interface */ #ifdef __cplusplus