summaryrefslogtreecommitdiff
path: root/ggml-impl.h
diff options
context:
space:
mode:
authorKawrakow <48489457+ikawrakow@users.noreply.github.com>2024-02-05 14:09:47 +0200
committerGitHub <noreply@github.com>2024-02-05 14:09:47 +0200
commitc6b395535a6874d749ef47c33eacd466cb252cd5 (patch)
tree5a8beca653005ee3946c1706ae510b31105315ce /ggml-impl.h
parentabb61944a5f64dec62c893ed0db10790169b672a (diff)
ggml : make use of ggml-quants.h possible in C++ code (#5338)
* Make use of ggml-quants.h possible in C++ code * One cannot possibly be defining static_assert in a C++ compilation --------- Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
Diffstat (limited to 'ggml-impl.h')
-rw-r--r--ggml-impl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/ggml-impl.h b/ggml-impl.h
index 2c58075a..19df66bc 100644
--- a/ggml-impl.h
+++ b/ggml-impl.h
@@ -19,6 +19,7 @@ extern "C" {
// fall back to the _Static_assert C11 keyword.
// if C99 - static_assert is noop
// ref: https://stackoverflow.com/a/53923785/4039976
+#ifndef __cplusplus
#ifndef static_assert
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201100L)
#define static_assert(cond, msg) _Static_assert(cond, msg)
@@ -26,6 +27,7 @@ extern "C" {
#define static_assert(cond, msg) struct global_scope_noop_trick
#endif
#endif
+#endif
// __FMA__ and __F16C__ are not defined in MSVC, however they are implied with AVX2/AVX512
#if defined(_MSC_VER) && (defined(__AVX2__) || defined(__AVX512F__))