Skip to content

Commit

Permalink
Disabling return-type-c-linkage error in clang via #pragma
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Oct 31, 2024
1 parent 225dbf4 commit f25b348
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/zhvlib/IO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#ifndef ZHIVO_STDLIB_IO_CC
#define ZHIVO_STDLIB_IO_CC

#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
#endif

#include "ZhivoLibrary.hpp"

ZHIVO_LIB_START
Expand Down Expand Up @@ -50,4 +55,8 @@ ZHIVO_FUNC(io_exit);

ZHIVO_LIB_END

#ifdef __clang__
# pragma clang diagnostic pop
#endif

#endif
9 changes: 9 additions & 0 deletions lib/zhvlib/ML.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#ifndef ZHIVO_STDLIB_ML_CC
#define ZHIVO_STDLIB_ML_CC

#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
#endif

#include "ZhivoLibrary.hpp"

ZHIVO_LIB_START
Expand All @@ -29,4 +34,8 @@ ZHIVO_FUNC(ml_trendline_predict);

ZHIVO_LIB_END

#ifdef __clang__
# pragma clang diagnostic pop
#endif

#endif
9 changes: 9 additions & 0 deletions lib/zhvlib/Math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#ifndef ZHIVO_STDLIB_MATH_CC
#define ZHIVO_STDLIB_MATH_CC

#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
#endif

#include "ZhivoLibrary.hpp"

ZHIVO_LIB_START
Expand All @@ -37,4 +42,8 @@ ZHIVO_FUNC(math_sigmoidDerivative);

ZHIVO_LIB_END

#ifdef __clang__
# pragma clang diagnostic pop
#endif

#endif
1 change: 1 addition & 0 deletions lib/zhvlib/Reflect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "zhvlib/Reflect.hpp"

#include <zhivo/ast/TerminativeSignal.hpp>
#include <zhivo/parser/Tokenizer.hpp>

ZHIVO_FUNC(reflect_get) {
if(args.size() != 1)
Expand Down
9 changes: 9 additions & 0 deletions lib/zhvlib/Reflect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#ifndef ZHIVO_STDLIB_REFLECT_CC
#define ZHIVO_STDLIB_REFLECT_CC

#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
#endif

#include "ZhivoLibrary.hpp"

ZHIVO_LIB_START
Expand All @@ -32,4 +37,8 @@ ZHIVO_FUNC(reflect_delete);

ZHIVO_LIB_END

#ifdef __clang__
# pragma clang diagnostic pop
#endif

#endif
9 changes: 9 additions & 0 deletions lib/zhvlib/UI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
#ifndef ZHIVO_STDLIB_IO_CC
#define ZHIVO_STDLIB_IO_CC

#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
#endif

#if !(defined(__APPLE__) && (defined(__aarch64__) || defined(__arm64__)))

#include "ZhivoLibrary.hpp"
Expand All @@ -44,4 +49,8 @@ ZHIVO_LIB_END
# pragma message("Libui is currently not supported for Apple M1 architecture.")
#endif

#ifdef __clang__
# pragma clang diagnostic pop
#endif

#endif

0 comments on commit f25b348

Please sign in to comment.