Ada 2.9.2
Fast spec-compliant URL parser
Loading...
Searching...
No Matches
common_defs.h File Reference

Common definitions for cross-platform compiler support. More...

Go to the source code of this file.

Namespaces

namespace  ada
 

Macros

#define ADA_BEGIN_DEBUG_BLOCK(name)
 
#define ADA_END_DEBUG_BLOCK(name)
 
#define ADA_DEBUG_BLOCK(name, block)
 
#define ADA_ROUNDUP_N(a, n)
 
#define ADA_ROUNDDOWN_N(a, n)
 
#define ADA_ISALIGNED_N(ptr, n)
 
#define ada_really_inline   inline __attribute__((always_inline))
 
#define ada_never_inline   inline __attribute__((noinline))
 
#define ada_unused   __attribute__((unused))
 
#define ada_warn_unused   __attribute__((warn_unused_result))
 
#define ADA_PUSH_DISABLE_WARNINGS   _Pragma("GCC diagnostic push")
 
#define ADA_PUSH_DISABLE_ALL_WARNINGS
 
#define ADA_PRAGMA(P)
 
#define ADA_DISABLE_GCC_WARNING(WARNING)
 
#define ADA_DISABLE_UNDESIRED_WARNINGS
 
#define ADA_DISABLE_DEPRECATED_WARNING    ADA_DISABLE_GCC_WARNING("-Wdeprecated-declarations")
 
#define ADA_DISABLE_STRICT_OVERFLOW_WARNING    ADA_DISABLE_GCC_WARNING("-Wstrict-overflow")
 
#define ADA_POP_DISABLE_WARNINGS   _Pragma("GCC diagnostic pop")
 
#define ADA_DLLIMPORTEXPORT
 
#define ADA_TRY(EXPR)
 If EXPR is an error, returns it.
 
#define __has_cpp_attribute(x)
 
#define ADA_ATTRIBUTE_NOINLINE
 
#define ADA_DEVELOPMENT_CHECKS   1
 
#define ADA_STR(x)
 
#define ADA_REQUIRE(EXPR)
 
#define ADA_FAIL(MESSAGE)
 
#define ADA_ASSERT_EQUAL(LHS, RHS, MESSAGE)
 
#define ADA_ASSERT_TRUE(COND)
 
#define ADA_ASSUME(COND)
 
#define ada_lifetime_bound
 

Functions

void ada::unreachable ()
 

Detailed Description

Common definitions for cross-platform compiler support.

Definition in file common_defs.h.

Macro Definition Documentation

◆ __has_cpp_attribute

#define __has_cpp_attribute ( x)
Value:
0

Definition at line 142 of file common_defs.h.

◆ ADA_ASSERT_EQUAL

#define ADA_ASSERT_EQUAL ( LHS,
RHS,
MESSAGE )
Value:
do { \
if (LHS != RHS) { \
std::cerr << "Mismatch: '" << LHS << "' - '" << RHS << "'" << std::endl; \
ADA_FAIL(MESSAGE); \
} \
} while (0);

Definition at line 199 of file common_defs.h.

Referenced by ada::url_aggregator::clear_hash(), and ada::url_aggregator::clear_search().

◆ ADA_ASSERT_TRUE

◆ ADA_ASSUME

#define ADA_ASSUME ( COND)
Value:
do { \
if (!(COND)) { \
__builtin_unreachable(); \
} \
} while (0)

Definition at line 223 of file common_defs.h.

◆ ADA_ATTRIBUTE_NOINLINE

#define ADA_ATTRIBUTE_NOINLINE

Definition at line 148 of file common_defs.h.

◆ ADA_BEGIN_DEBUG_BLOCK

#define ADA_BEGIN_DEBUG_BLOCK ( name)

Definition at line 33 of file common_defs.h.

◆ ADA_DEBUG_BLOCK

#define ADA_DEBUG_BLOCK ( name,
block )

Definition at line 35 of file common_defs.h.

◆ ADA_DEVELOPMENT_CHECKS

#define ADA_DEVELOPMENT_CHECKS   1

Definition at line 182 of file common_defs.h.

◆ ADA_DISABLE_DEPRECATED_WARNING

#define ADA_DISABLE_DEPRECATED_WARNING    ADA_DISABLE_GCC_WARNING("-Wdeprecated-declarations")

Definition at line 108 of file common_defs.h.

◆ ADA_DISABLE_GCC_WARNING

#define ADA_DISABLE_GCC_WARNING ( WARNING)
Value:
ADA_PRAGMA(GCC diagnostic ignored WARNING)
#define ADA_PRAGMA(P)
Definition common_defs.h:99

Definition at line 100 of file common_defs.h.

◆ ADA_DISABLE_STRICT_OVERFLOW_WARNING

#define ADA_DISABLE_STRICT_OVERFLOW_WARNING    ADA_DISABLE_GCC_WARNING("-Wstrict-overflow")

Definition at line 110 of file common_defs.h.

◆ ADA_DISABLE_UNDESIRED_WARNINGS

#define ADA_DISABLE_UNDESIRED_WARNINGS

Definition at line 106 of file common_defs.h.

◆ ADA_DLLIMPORTEXPORT

#define ADA_DLLIMPORTEXPORT

Definition at line 128 of file common_defs.h.

◆ ADA_END_DEBUG_BLOCK

#define ADA_END_DEBUG_BLOCK ( name)

Definition at line 34 of file common_defs.h.

◆ ADA_FAIL

#define ADA_FAIL ( MESSAGE)
Value:
do { \
std::cerr << "FAIL: " << (MESSAGE) << std::endl; \
abort(); \
} while (0);

Definition at line 194 of file common_defs.h.

◆ ADA_ISALIGNED_N

#define ADA_ISALIGNED_N ( ptr,
n )
Value:
(((uintptr_t)(ptr) & ((n)-1)) == 0)

Definition at line 42 of file common_defs.h.

◆ ada_lifetime_bound

#define ada_lifetime_bound

Definition at line 250 of file common_defs.h.

◆ ada_never_inline

#define ada_never_inline   inline __attribute__((noinline))

Definition at line 78 of file common_defs.h.

◆ ADA_POP_DISABLE_WARNINGS

#define ADA_POP_DISABLE_WARNINGS   _Pragma("GCC diagnostic pop")

Definition at line 112 of file common_defs.h.

◆ ADA_PRAGMA

#define ADA_PRAGMA ( P)
Value:
_Pragma(#P)

Definition at line 99 of file common_defs.h.

◆ ADA_PUSH_DISABLE_ALL_WARNINGS

#define ADA_PUSH_DISABLE_ALL_WARNINGS
Value:
ADA_PUSH_DISABLE_WARNINGS \
ADA_DISABLE_GCC_WARNING("-Weffc++") \
ADA_DISABLE_GCC_WARNING("-Wall") \
ADA_DISABLE_GCC_WARNING("-Wconversion") \
ADA_DISABLE_GCC_WARNING("-Wextra") \
ADA_DISABLE_GCC_WARNING("-Wattributes") \
ADA_DISABLE_GCC_WARNING("-Wimplicit-fallthrough") \
ADA_DISABLE_GCC_WARNING("-Wnon-virtual-dtor") \
ADA_DISABLE_GCC_WARNING("-Wreturn-type") \
ADA_DISABLE_GCC_WARNING("-Wshadow") \
ADA_DISABLE_GCC_WARNING("-Wunused-parameter") \
ADA_DISABLE_GCC_WARNING("-Wunused-variable")

Definition at line 86 of file common_defs.h.

◆ ADA_PUSH_DISABLE_WARNINGS

#define ADA_PUSH_DISABLE_WARNINGS   _Pragma("GCC diagnostic push")

Definition at line 83 of file common_defs.h.

◆ ada_really_inline

#define ada_really_inline   inline __attribute__((always_inline))

Definition at line 77 of file common_defs.h.

◆ ADA_REQUIRE

#define ADA_REQUIRE ( EXPR)
Value:
{ \
if (!(EXPR) { abort(); }) }

Definition at line 190 of file common_defs.h.

◆ ADA_ROUNDDOWN_N

#define ADA_ROUNDDOWN_N ( a,
n )
Value:
((a) & ~((n)-1))

Definition at line 40 of file common_defs.h.

◆ ADA_ROUNDUP_N

#define ADA_ROUNDUP_N ( a,
n )
Value:
(((a) + ((n)-1)) & ~((n)-1))

Definition at line 39 of file common_defs.h.

◆ ADA_STR

#define ADA_STR ( x)
Value:
#x

Definition at line 187 of file common_defs.h.

◆ ADA_TRY

#define ADA_TRY ( EXPR)
Value:
{ \
auto _err = (EXPR); \
if (_err) { \
return _err; \
} \
}

If EXPR is an error, returns it.

Definition at line 132 of file common_defs.h.

◆ ada_unused

#define ada_unused   __attribute__((unused))

Definition at line 80 of file common_defs.h.

◆ ada_warn_unused

#define ada_warn_unused   __attribute__((warn_unused_result))

Definition at line 81 of file common_defs.h.