Skip to content

Commit e156648

Browse files
committed
try to fix clang compilation errors, 5th attempt
1 parent 66b35c8 commit e156648

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ggml/src/ggml-cpu/ggml-cpu-impl.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,13 @@ void ggml_barrier(struct ggml_threadpool * tp);
510510
#define GGML_DO_PRAGMA_(x) _Pragma (#x)
511511
#define GGML_DO_PRAGMA(x) GGML_DO_PRAGMA_(x)
512512
#if defined(__GNUC__)
513-
// GCC/Clang
514-
# define GGML_WEAK_ALIAS(name, alias) GGML_DO_PRAGMA(weak name = alias) // NOLINT
515-
#elif defined(_MSC_VER) && defined (_M_AMD64)
513+
// GCC/Clang on *nix
514+
# if defined(__APPLE__) && !defined(TARGET_OS_OSX)
515+
# define GGML_WEAK_ALIAS(name, alias) GGML_DO_PRAGMA(weak _ ## name = _ ## alias) // NOLINT
516+
# else
517+
# define GGML_WEAK_ALIAS(name, alias) GGML_DO_PRAGMA(weak name = alias) // NOLINT
518+
# endif
519+
#elif defined(_MSC_VER) && defined (_WIN64)
516520
// MSVC
517521
// Note: C name mangling varies across different calling conventions
518522
// see https://learn.microsoft.com/en-us/cpp/build/reference/decorated-names?view=msvc-170

0 commit comments

Comments
 (0)