// // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo // // The contents of this file are covered under the licence agreement in the // file "LICENCE" distributed with Cforall. // // defs.hfa -- Commen macros, functions and typedefs // Most files depend on them and they are always useful to have. // // *** Must not contain code specific to libcfathread *** // // Author : Thierry Delisle // Created On : Thu Nov 9 13:24:10 2017 // Last Modified By : Peter A. Buhr // Last Modified On : Sat Jul 4 15:04:20 2026 // Update Count : 26 // #pragma once #include #include #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) typedef void (* fptr_t)(); typedef int_fast16_t __lock_size_t; #ifdef __cforall #define __cfa_anonymous_object(x) inline struct x #else #define __cfa_anonymous_object(x) struct x __cfa_anonymous_object #endif #if defined(__has_attribute) #if !__has_attribute(__noclone__) #define ATTRIBUTE_NOCLONE #endif #endif #ifndef ATTRIBUTE_NOCLONE #define ATTRIBUTE_NOCLONE __attribute__((__noclone__)) #endif #define libcfa_public __attribute__((visibility("default"))) #define libcfa_nopreempt __attribute__((section("cfatext_nopreempt"))) __attribute__((__noinline__)) ATTRIBUTE_NOCLONE struct __cfa_nopreempt_region { void * start; void * stop; }; #ifdef __cforall void abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )); void abort( bool signalAbort, const char fmt[], ... ) __attribute__ (( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ )); extern "C" { #endif void __cabi_abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )); #ifdef __cforall } #endif #if defined(__cforall_thread__) #define OPTIONAL_THREAD #else #define OPTIONAL_THREAD __attribute__((weak)) #endif #define CFA_IO_LAZY (1_l64u << 32_l64u)