40#ifndef GEOGRAM_BASIC_COMMON
41#define GEOGRAM_BASIC_COMMON
198#if (defined(NDEBUG) || defined(GEOGRAM_PSM)) && !defined(GEOGRAM_PSM_DEBUG)
208#if defined(__ANDROID__)
209#define GEO_OS_ANDROID
212#if defined(__linux__)
217#ifndef GEO_OS_ANDROID
225#if defined(__INTEL_COMPILER)
226# define GEO_COMPILER_INTEL
227#elif defined(__clang__)
228# define GEO_COMPILER_CLANG
229#elif defined(__GNUC__)
230# define GEO_COMPILER_GCC
232# error "Unsupported compiler"
238# define GEO_PROCESSOR_X86
245#elif defined(_WIN32) || defined(_WIN64)
247#define GEO_OS_WINDOWS
248#define GEO_PROCESSOR_X86
255# define GEO_COMPILER_MSVC
256#elif defined(__MINGW32__) || defined(__MINGW64__)
257# define GEO_COMPILER_MINGW
268#elif defined(__APPLE__)
277#if defined(__clang__)
278# define GEO_COMPILER_CLANG
279#elif defined(__GNUC__)
280# define GEO_COMPILER_GCC
282# error "Unsupported compiler"
285#if defined(__x86_64) || defined(__ppc64__) || defined(__arm64__) || defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64) || defined(__loongarch_lp64)
293#elif defined(__EMSCRIPTEN__)
295#include <emscripten.h>
299#define GEO_OS_EMSCRIPTEN
301#define GEO_COMPILER_EMSCRIPTEN
302#define GEO_COMPILER_CLANG
306#error "Unsupported operating system"
309#if defined(GEO_COMPILER_GCC) || \
310 defined(GEO_COMPILER_CLANG) || \
311 defined(GEO_COMPILER_MINGW) || \
312 defined(GEO_COMPILER_EMSCRIPTEN)
313#define GEO_COMPILER_GCC_FAMILY
318#define GEO_OS_WINDOWS
320#define GEO_OS_ANDROID
322#define GEO_COMPILER_INTEL
323#define GEO_COMPILER_MSVC
330#define CPP_CONCAT_(A, B) A ## B
336#define CPP_CONCAT(A, B) CPP_CONCAT_(A, B)
340#elif defined(GEO_COMPILER_GCC_FAMILY) || \
341 defined(GEO_COMPILER_INTEL)
342#define GEO_NORETURN __attribute__((noreturn))
348#define GEO_NORETURN_DECL
349#elif defined(GEO_COMPILER_MSVC)
350#define GEO_NORETURN_DECL __declspec(noreturn)
352#define GEO_NORETURN_DECL
355#if defined(GEO_COMPILER_CLANG) || defined(GEO_COMPILER_EMSCRIPTEN)
356#if __has_feature(cxx_noexcept)
357#define GEO_NOEXCEPT noexcept
367#define GEO_NOEXCEPT throw()
373#define GEO_NODISCARD [[nodiscard]]
376#define FOR(I,UPPERBND) for(index_t I = 0; I<index_t(UPPERBND); ++I)
381#ifdef GEO_COMPILER_CLANG
382#pragma GCC diagnostic ignored "-Walloca"
387#if !defined(GEO_COMPILER_CLANG) && \
388 !defined(GEO_OS_EMSCRIPTEN) && \
389 !defined(GEO_NO_PARALLEL_STL)
390#define GEO_PARALLEL_STL
Basic definitions for the Geogram C API.
Global Vorpaline namespace.
void terminate()
Cleans up Geogram.
@ GEOGRAM_INSTALL_LOCALE
Sets the locale to POSIX.
@ GEOGRAM_INSTALL_HANDLERS
Install Geogram's signal handlers.
@ GEOGRAM_INSTALL_BIBLIO
Enable global citation database.
@ GEOGRAM_INSTALL_NONE
Do not install error handlers.
@ GEOGRAM_INSTALL_FPE
Enable or disable FPE during initialization.
@ GEOGRAM_INSTALL_ALL
Install everything.
@ GEOGRAM_INSTALL_ERRNO
Reset errno to 0.
void initialize(int flags=GEOGRAM_INSTALL_NONE)
Initialize Geogram.