Compiler support

Compiler-level abstraction.

Summary
Compiler supportCompiler-level abstraction.
Global Declaration MacrosThese macros are meant to be used to delimit declarations in public header files.
NACORE_BEGIN_C_DECLSDelimits the beginning of public declarations.
NACORE_END_C_DECLSDelimits the end of public declarations.
Symbol Declaration MacrosThese macros are meant to be used for SINGLE symbol declarations (variables or functions) by prepending them to such declarations.
NACORE_IMPORTSpecifies that a symbol is imported from a library.
NACORE_EXPORTSpecifies that a symbol is to be exported.
NACORE_PUBLICSpecifies that a symbol is publicly visible.
NACORE_PRIVATESpecifies that a symbol has hidden visibility.
NACORE_FORMAT_PRINTF(string_index, first_to_check)Specifies that a function takes printf()-style arguments.
NACORE_FORMAT_VPRINTF(string_index)Specifies that a function takes vprintf()-style arguments.

Global Declaration Macros

These macros are meant to be used to delimit declarations in public header files.

Example

myheader.h

#ifndef MY_HEADER_H
#define MY_HEADER_H

NACORE_BEGIN_C_DECLS

... blah blah blah ...

NACORE_END_C_DECLS

#endif

NACORE_BEGIN_C_DECLS

Delimits the beginning of public declarations.

So that C++ compilers don’t mangle their names.

NACORE_END_C_DECLS

Delimits the end of public declarations.

So that C++ compilers don’t mangle their names.

Symbol Declaration Macros

These macros are meant to be used for SINGLE symbol declarations (variables or functions) by prepending them to such declarations.

They can be combined together, unless otherwise told.

Example

myfunc.h

NACORE_PUBLIC void myfunc();

myfunc.c

NACORE_PUBLIC void
myfunc()
{
        ... blah blah blah ...
}

NACORE_IMPORT

Specifies that a symbol is imported from a library.

Cannot be combined with NACORE_EXPORT.

NACORE_EXPORT

Specifies that a symbol is to be exported.

Cannot be combined with NACORE_IMPORT.

NACORE_PUBLIC

Specifies that a symbol is publicly visible.

Cannot be combined with NACORE_PRIVATE.

NACORE_PRIVATE

Specifies that a symbol has hidden visibility.

Cannot be combined with NACORE_PUBLIC.

NACORE_FORMAT_PRINTF(string_index, first_to_check)

Specifies that a function takes printf()-style arguments.

Cannot be combined with NACORE_FORMAT_VPRINTF(string_index).

Paramters

string_indexIndex of the format string argument (starting from 1).
first_to_checkIndex of the first argument to be checked against the format string (starting from 1).

NACORE_FORMAT_VPRINTF(string_index)

Specifies that a function takes vprintf()-style arguments.

Cannot be combined with NACORE_FORMAT_PRINTF(string_index, first_to_check).

Parameters

string_indexIndex of the format string argument (starting from 1).
Specifies that a symbol is to be exported.
Specifies that a symbol is imported from a library.
Specifies that a symbol has hidden visibility.
Specifies that a symbol is publicly visible.
Specifies that a function takes vprintf()-style arguments.
Specifies that a function takes printf()-style arguments.
Close