JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
Configuration

Macros

#define JSONV_VERSION_MAJOR   2
 The major version of JSON Voorhees these headers belong to.
 
#define JSONV_VERSION_MINOR   0
 The minor version of JSON Voorhees these headers belong to.
 
#define JSONV_VERSION_PATCH   0
 The patch version of JSON Voorhees these headers belong to.
 
#define JSONV_VERSION_PRERELEASE   "rc.1"
 The pre-release of JSON Voorhees these headers belong to, as a string literal: "rc.1" for 2.0.0-rc.1 and "" for a release.
 
#define JSONV_VERSION   (JSONV_VERSION_MAJOR * 1000000 + JSONV_VERSION_MINOR * 1000 + JSONV_VERSION_PATCH)
 The version of JSON Voorhees these headers belong to as a single number, JSONV_VERSION_MAJOR * 1000000 + JSONV_VERSION_MINOR * 1000 + JSONV_VERSION_PATCH, so a version check can be written as #if JSONV_VERSION >= 2000000.
 
#define JSONV_DEBUG   0
 Was JSON Voorhees compiled in debug mode? This value must be the same between when the SO was built and when you are compiling.
 
#define JSONV_SO   1
 Are you using shared objects (DLLs in Windows)?
 
#define JSONV_COMPILING   0
 Is JSON Voorhees currently compiling? You do not want to set this by hand.
 
#define JSONV_EXPORT
 If using shared objects, this class or function should be exported.
 
#define JSONV_IMPORT
 If using shared objects, this class or function should be imported.
 
#define JSONV_HIDDEN
 This symbol is only visible within the same shared object in which the translation unit will end up.
 
#define JSONV_PUBLIC   JSONV_IMPORT
 This function or class is part of the public API for JSON Voorhees.
 
#define JSONV_LOCAL   JSONV_HIDDEN
 This function or class is internal-use only.
 
#define JSONV_UNUSED   [[maybe_unused]]
 Note that you know the variable is unused, but make the compiler stop complaining about it.
 
#define JSONV_NODISCARD   [[nodiscard]]
 Warn if the caller discards the result of this function.
 
#define JSONV_NO_RETURN   [[noreturn]]
 Mark that a given function will never return control to the caller, either by exiting or throwing an exception.
 
#define JSONV_INTEGER_ALTERNATES_LIST(item)
 An item list of types to also consider as an integer.
 

Detailed Description

Macro Definition Documentation

◆ JSONV_COMPILING

#define JSONV_COMPILING   0

Is JSON Voorhees currently compiling? You do not want to set this by hand.

It is set by the build system when the library is compiled.

Definition at line 74 of file config.hpp.

◆ JSONV_DEBUG

#define JSONV_DEBUG   0

Was JSON Voorhees compiled in debug mode? This value must be the same between when the SO was built and when you are compiling.

In general, this is not useful outside of library maintainers.

Warning
Keep in mind this value is always defined. Use #if JSONV_DEBUG, not #ifdef JSONV_DEBUG.

Definition at line 58 of file config.hpp.

◆ JSONV_EXPORT

#define JSONV_EXPORT

If using shared objects, this class or function should be exported.

Definition at line 107 of file config.hpp.

◆ JSONV_HIDDEN

#define JSONV_HIDDEN

This symbol is only visible within the same shared object in which the translation unit will end up.

Symbols which are "hidden" will not be put into the global offset table, which means code can be more optimal when it involves hidden symbols at the cost that nothing outside of the SO can access it.

Definition at line 109 of file config.hpp.

◆ JSONV_IMPORT

#define JSONV_IMPORT

If using shared objects, this class or function should be imported.

Definition at line 108 of file config.hpp.

◆ JSONV_INTEGER_ALTERNATES_LIST

#define JSONV_INTEGER_ALTERNATES_LIST (   item)
Value:
item(int) \
item(unsigned int) \
item(unsigned long) \
item(unsigned long long)

An item list of types to also consider as an integer.

This mostly exists to help resolve the C-induced type ambiguity for the literal 0. It most prefers to be an int, but might also become a long or a pointer type.

Definition at line 158 of file config.hpp.

◆ JSONV_LOCAL

#define JSONV_LOCAL   JSONV_HIDDEN

This function or class is internal-use only.

See also
JSONV_HIDDEN

Definition at line 125 of file config.hpp.

◆ JSONV_NO_RETURN

#define JSONV_NO_RETURN   [[noreturn]]

Mark that a given function will never return control to the caller, either by exiting or throwing an exception.

Definition at line 150 of file config.hpp.

◆ JSONV_NODISCARD

#define JSONV_NODISCARD   [[nodiscard]]

Warn if the caller discards the result of this function.

This decorates the side-effect-free parts of the API, where dropping the result means the call did nothing at all.

The guard checks JSONV_DOXYGEN as well as the usual ifndef because config/Doxyfile predefines this macro as empty to keep it out of the rendered signatures. That also hides this define from Doxygen, which then warns about documentation for a macro it never saw; re-entering the block for Doxygen alone keeps the two consistent. No compiler defines JSONV_DOXYGEN, so everywhere else this is exactly the ifndef its siblings use.

Definition at line 143 of file config.hpp.

◆ JSONV_PUBLIC

#define JSONV_PUBLIC   JSONV_IMPORT

This function or class is part of the public API for JSON Voorhees.

If you are including JsonVoorhees for another library, this will have import semantics (JSONV_IMPORT); if you are building JsonVoorhees, this will have export semantics (JSONV_EXPORT).

Definition at line 124 of file config.hpp.

◆ JSONV_SO

#define JSONV_SO   1

Are you using shared objects (DLLs in Windows)?

Definition at line 64 of file config.hpp.

◆ JSONV_UNUSED

#define JSONV_UNUSED   [[maybe_unused]]

Note that you know the variable is unused, but make the compiler stop complaining about it.

Definition at line 131 of file config.hpp.

◆ JSONV_VERSION

#define JSONV_VERSION   (JSONV_VERSION_MAJOR * 1000000 + JSONV_VERSION_MINOR * 1000 + JSONV_VERSION_PATCH)

The version of JSON Voorhees these headers belong to as a single number, JSONV_VERSION_MAJOR * 1000000 + JSONV_VERSION_MINOR * 1000 + JSONV_VERSION_PATCH, so a version check can be written as #if JSONV_VERSION >= 2000000.

It does not carry JSONV_VERSION_PRERELEASE.

Definition at line 48 of file config.hpp.

◆ JSONV_VERSION_MAJOR

#define JSONV_VERSION_MAJOR   2

The major version of JSON Voorhees these headers belong to.

Definition at line 23 of file config.hpp.

◆ JSONV_VERSION_MINOR

#define JSONV_VERSION_MINOR   0

The minor version of JSON Voorhees these headers belong to.

Definition at line 27 of file config.hpp.

◆ JSONV_VERSION_PATCH

#define JSONV_VERSION_PATCH   0

The patch version of JSON Voorhees these headers belong to.

Definition at line 31 of file config.hpp.

◆ JSONV_VERSION_PRERELEASE

#define JSONV_VERSION_PRERELEASE   "rc.1"

The pre-release of JSON Voorhees these headers belong to, as a string literal: "rc.1" for 2.0.0-rc.1 and "" for a release.

It is a SemVer pre-release written without the - which joins it to the version, and the build accepts only dot-separated letters and digits.

A pre-release has the same three numbers, and so the same JSONV_VERSION, as the release it leads up to: a check such as #if JSONV_VERSION >= 2000000 holds for the release candidates of 2.0.0 as well as for 2.0.0 itself. The preprocessor cannot look inside a string, but std::string_view(JSONV_VERSION_PRERELEASE).empty() is a constant expression which is true for a release.

Definition at line 42 of file config.hpp.