/* Nim's Runtime Library (c) Copyright 2015 Andreas Rumpf See the file "copying.txt", included in this distribution, for details about the copyright. */ /* compiler symbols: __BORLANDC__ _MSC_VER __WATCOMC__ __LCC__ __GNUC__ __DMC__ __POCC__ __TINYC__ __clang__ */ #ifndef NIMBASE_H #define NIMBASE_H /*------------ declaring a custom attribute to support using LLVM's Address Sanitizer ------------ */ /* This definition exists to provide support for using the LLVM ASAN (Address SANitizer) tooling with Nim. This should only be used to mark implementations of the GC system that raise false flags with the ASAN tooling, or for functions that are hot and need to be disabled for performance reasons. Based on the official ASAN documentation, both the clang and gcc compilers are supported. In addition to that, a check is performed to verify that the necessary attribute is supported by the compiler. To flag a proc as ignored, append the following code pragma to the proc declaration: {.codegenDecl: "CLANG_NO_SANITIZE_ADDRESS $# $#$#".} For further information, please refer to the official documentation: https://github.com/google/sanitizers/wiki/AddressSanitizer */ #define CLANG_NO_SANITIZE_ADDRESS #if defined(__clang__) # if __has_attribute(no_sanitize_address) # undef CLANG_NO_SANITIZE_ADDRESS # define CLANG_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) # endif #endif /* ------------ ignore typical warnings in Nim-generated files ------------- */ #if defined(__GNUC__) || defined(__clang__) # pragma GCC diagnostic ignored "-Wpragmas" # pragma GCC diagnostic ignored "-Wwritable-strings" # pragma GCC diagnostic ignored "-Winvalid-noreturn" # pragma GCC diagnostic ignored "-Wformat" # pragma GCC diagnostic ignored "-Wlogical-not-parentheses" # pragma GCC diagnostic ignored "-Wlogical-op-parentheses" # pragma GCC diagnostic ignored "-Wshadow" # pragma GCC diagnostic ignored "-Wunused-function" # pragma GCC diagnostic ignored "-Wunused-variable" # pragma GCC diagnostic ignored "-Winvalid-offsetof" # pragma GCC diagnostic ignored "-Wtautological-compare" # pragma GCC diagnostic ignored "-Wswitch-bool" # pragma GCC diagnostic ignored "-Wmacro-redefined" # pragma GCC diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" # pragma GCC diagnostic ignored "-Wpointer-bool-conversion" # pragma GCC diagnostic ignored "-Wconstant-conversion" #endif #if defined(_MSC_VER) # pragma warning(disable: 4005 4100 4101 4189 4191 4200 4244 4293 4296 4309) # pragma warning(disable: 4310 4365 4456 4477 4514 4574 4611 4668 4702 4706) # pragma warning(disable: 4710 4711 4774 4800 4820 4996 4090) #endif /* ------------------------------------------------------------------------- */ #if defined(__GNUC__) # define _GNU_SOURCE 1 #endif #if defined(__TINYC__) /*# define __GNUC__ 3 # define GCC_MAJOR 4 # define __GNUC_MINOR__ 4 # define __GNUC_PATCHLEVEL__ 5 */ # define __DECLSPEC_SUPPORTED 1 #endif /* calling convention mess ----------------------------------------------- */ #if defined(__GNUC__) || defined(__LCC__) || defined(__POCC__) \ || defined(__TINYC__) /* these should support C99's inline */ /* the test for __POCC__ has to come before the test for _MSC_VER, because PellesC defines _MSC_VER too. This is brain-dead. */ # define N_INLINE(rettype, name) inline rettype name #elif defined(__BORLANDC__) || defined(_MSC_VER) /* Borland's compiler is really STRANGE here; note that the __fastcall keyword cannot be before the return type, but __inline cannot be after the return type, so we do not handle this mess in the code generator but rather here. */ # define N_INLINE(rettype, name) __inline rettype name #elif defined(__DMC__) # define N_INLINE(rettype, name) inline rettype name #elif defined(__WATCOMC__) # define N_INLINE(rettype, name) __inline rettype n
import m17385
let a = Diff[int]()
a.test()