mirror of
https://github.com/logos-storage/nim-libplum.git
synced 2026-06-07 09:40:01 +00:00
Remove GCC marning
This commit is contained in:
parent
269d97548c
commit
9f7833edf1
@ -12,14 +12,18 @@ const
|
||||
rootPath = currentSourcePath.parentDir().parentDir().replace('\\', '/')
|
||||
libplumPath = rootPath & "/vendor/libplum"
|
||||
includePath = libplumPath & "/include/plum"
|
||||
libraryPath = libplumPath & "/build/libplum.a"
|
||||
libraryPath = libplumPath & "/libplum.a"
|
||||
{.passc: "-I" & includePath & " -DPLUM_STATIC".}
|
||||
{.passl: libraryPath.}
|
||||
# libplum declares some parameters as `const T*` in C (read-only pointer).
|
||||
# Nim has no equivalent, so the generated C code drops the `const`, causing
|
||||
# a type mismatch warning in GCC 15+. This flag suppresses that warning.
|
||||
# It is safe because we never write through those pointers.
|
||||
{.passc: "-Wno-incompatible-pointer-types".}
|
||||
# a type mismatch warning in GCC 15+. This pragma suppresses that warning
|
||||
# only in this translation unit and is valid for both C and C++.
|
||||
{.emit: """
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic ignored "-Wno-incompatible-pointer-types"
|
||||
#endif
|
||||
""".}
|
||||
|
||||
when defined(windows):
|
||||
{.passl: "-lws2_32 -liphlpapi -lbcrypt".}
|
||||
|
||||
@ -12,6 +12,12 @@ import chronos/threadsync
|
||||
import results
|
||||
import ./libplum
|
||||
|
||||
{.emit: """
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
|
||||
#endif
|
||||
""".}
|
||||
|
||||
export results
|
||||
|
||||
{.pragma: callback, cdecl, raises: [], gcsafe.}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user