ggerganov commited on
Commit
d47070d
·
1 Parent(s): 4043835

ggml : fix weak alias win32 (#0)

Browse files
Files changed (1) hide show
  1. ggml/src/ggml-cpu/ggml-cpu-impl.h +4 -1
ggml/src/ggml-cpu/ggml-cpu-impl.h CHANGED
@@ -518,11 +518,14 @@ void ggml_barrier(struct ggml_threadpool * tp);
518
  #elif defined(__GNUC__)
519
  // GCC/Clang on *nix
520
  # define GGML_WEAK_ALIAS(name, alias) GGML_DO_PRAGMA(weak name = alias) // NOLINT
521
- #elif defined(_MSC_VER) && defined (_WIN64)
522
  // MSVC
523
  // Note: C name mangling varies across different calling conventions
524
  // see https://learn.microsoft.com/en-us/cpp/build/reference/decorated-names?view=msvc-170
525
  # define GGML_WEAK_ALIAS(name, alias) GGML_DO_PRAGMA(comment(linker, "/alternatename:" #name "=" #alias))
 
 
 
526
  #else
527
  # error "Unsupported compiler for GGML_WEAK_ALIAS"
528
  #endif
 
518
  #elif defined(__GNUC__)
519
  // GCC/Clang on *nix
520
  # define GGML_WEAK_ALIAS(name, alias) GGML_DO_PRAGMA(weak name = alias) // NOLINT
521
+ #elif defined(_MSC_VER) && defined(_WIN64)
522
  // MSVC
523
  // Note: C name mangling varies across different calling conventions
524
  // see https://learn.microsoft.com/en-us/cpp/build/reference/decorated-names?view=msvc-170
525
  # define GGML_WEAK_ALIAS(name, alias) GGML_DO_PRAGMA(comment(linker, "/alternatename:" #name "=" #alias))
526
+ #elif defined(_MSC_VER) && defined(WIN32)
527
+ // ref: https://github.com/ggml-org/whisper.cpp/pull/3239#issuecomment-2958224591
528
+ # define GGML_WEAK_ALIAS(name, alias) GGML_DO_PRAGMA(comment(linker, "/alternatename:_" #name "=_" #alias))
529
  #else
530
  # error "Unsupported compiler for GGML_WEAK_ALIAS"
531
  #endif