YARP
Yet Another Robot Platform
system.h File Reference

Go to the source code of this file.

Macros

#define YARP_HAS_EXECINFO_H
 
#define YARP_HAS_SYS_WAIT_H
 
#define YARP_HAS_SYS_TYPES_H
 
#define YARP_HAS_SYS_PRCTL_H
 
#define YARP_HAS_SIGNAL_H
 
#define YARP_HAS_SYS_SIGNAL_H
 
#define YARP_HAS_NETDB_H
 
#define YARP_HAS_DLFCN_H
 
#define YARP_HAS_IFADDRS_H
 
#define YARP_POINTER_SIZE   8
 
#define YARP_DISABLE_CLASS_ENUM_API_WARNING
 
#define YARP_COMPILER_MESSAGE(x)
 Print a message at build time on supported compilers. More...
 
#define YARP_COMPILER_WARNING(x)
 Generate a warning at build time on supported compilers. More...
 
#define YARP_COMPILER_ERROR(x)
 Generate an error at build time on supported compilers. More...
 
#define YARP_COMPILER_DEPRECATED_WARNING(x)   YARP_COMPILER_WARNING(x)
 Generate a warning at build time on supported compilers if deprecated warnings are enabled. More...
 
#define YARP_BEGIN_PACK
 Starts 1 byte packing for structs/classes. More...
 
#define YARP_END_PACK
 Ends 1 byte packing for structs/classes. More...
 
#define YARP_WARNING_PUSH
 Starts a temporary alteration of the enabled warnings. More...
 
#define YARP_WARNING_POP
 Ends a temporary alteration of the enabled warnings. More...
 
#define YARP_DISABLE_DEPRECATED_WARNING
 Disable deprecated warnings in the following code. More...
 
#define YARP_DISABLE_DLL_INTERFACE_WARNING
 Disable MSVC C4251 warnings in the following code. More...
 
#define YARP_SUPPRESS_DLL_INTERFACE_WARNING
 Suppress MSVC C4251 warning for the next line. More...
 
#define YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG(x)   x
 Suppress MSVC C4251 warning for the declaration. More...
 
#define YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARGS(...)   __VA_ARGS__
 Suppress MSVC C4251 warning for the declaration. More...
 

Macro Definition Documentation

◆ YARP_BEGIN_PACK

#define YARP_BEGIN_PACK

Starts 1 byte packing for structs/classes.

Instructs the compiler that the following structure/class has to be packed with 1 byte boundary. This is conditionally generated depending on the compiler and architecture. It assures interoperability of network communication between compilers.

See also
Datatypes, YARP_END_PACK
Examples
port_power/TargetVer1.h, and port_power/TargetVer1b.h.

Definition at line 190 of file system.h.

◆ YARP_COMPILER_DEPRECATED_WARNING

#define YARP_COMPILER_DEPRECATED_WARNING (   x)    YARP_COMPILER_WARNING(x)

Generate a warning at build time on supported compilers if deprecated warnings are enabled.

This can be useful for example to deprecate a header file.

Parameters
xDeprecation message.
See also
YARP_COMPILER_MESSAGE, YARP_COMPILER_WARNING, YARP_COMPILER_ERROR

Definition at line 114 of file system.h.

◆ YARP_COMPILER_ERROR

#define YARP_COMPILER_ERROR (   x)

Generate an error at build time on supported compilers.

For example:

YARP_COMPILER_ERROR(This is a custom compiler error)
#define YARP_COMPILER_ERROR(x)
Generate an error at build time on supported compilers.
Definition: system.h:110

will generate an error "This is a custom compiler error".

Parameters
xError message.
See also
YARP_COMPILER_MESSAGE, YARP_COMPILER_WARNING, YARP_COMPILER_DEPRECATED_WARNING

Definition at line 110 of file system.h.

◆ YARP_COMPILER_MESSAGE

#define YARP_COMPILER_MESSAGE (   x)

Print a message at build time on supported compilers.

For example:

YARP_COMPILER_MESSAGE(This is a custom compiler message)
#define YARP_COMPILER_MESSAGE(x)
Print a message at build time on supported compilers.
Definition: system.h:108

will print "This is a custom compiler message".

Parameters
xMessage.
See also
YARP_COMPILER_WARNING, YARP_COMPILER_ERROR, YARP_COMPILER_DEPRECATED_WARNING

Definition at line 108 of file system.h.

◆ YARP_COMPILER_WARNING

#define YARP_COMPILER_WARNING (   x)

Generate a warning at build time on supported compilers.

For example:

YARP_COMPILER_WARNING(This is a custom compiler warning)
#define YARP_COMPILER_WARNING(x)
Generate a warning at build time on supported compilers.
Definition: system.h:109

will generate a warning "This is a custom compiler warning"

Parameters
xWarning message.
See also
YARP_COMPILER_MESSAGE, YARP_COMPILER_ERROR, YARP_COMPILER_DEPRECATED_WARNING

Definition at line 109 of file system.h.

◆ YARP_DISABLE_CLASS_ENUM_API_WARNING

#define YARP_DISABLE_CLASS_ENUM_API_WARNING

Definition at line 346 of file system.h.

◆ YARP_DISABLE_DEPRECATED_WARNING

#define YARP_DISABLE_DEPRECATED_WARNING

Disable deprecated warnings in the following code.

It should be used in this way:

do_something_deprecated();
#define YARP_WARNING_POP
Ends a temporary alteration of the enabled warnings.
Definition: system.h:332
#define YARP_WARNING_PUSH
Starts a temporary alteration of the enabled warnings.
Definition: system.h:331
#define YARP_DISABLE_DEPRECATED_WARNING
Disable deprecated warnings in the following code.
Definition: system.h:333
See also
YARP_WARNING_PUSH, YARP_WARNING_POP

Definition at line 333 of file system.h.

◆ YARP_DISABLE_DLL_INTERFACE_WARNING

#define YARP_DISABLE_DLL_INTERFACE_WARNING

Disable MSVC C4251 warnings in the following code.

It should be used in this way:

std::string foo;
std::string bar;
#define YARP_DISABLE_DLL_INTERFACE_WARNING
Disable MSVC C4251 warnings in the following code.
Definition: system.h:334
See also
YARP_WARNING_PUSH, YARP_WARNING_POP, YARP_SUPPRESS_DLL_INTERFACE_WARNING, YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG, YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARGS

Definition at line 334 of file system.h.

◆ YARP_END_PACK

#define YARP_END_PACK

Ends 1 byte packing for structs/classes.

Instructs the compiler that the default packing can be reinstated.

See also
Datatypes YARP_BEGIN_PACK
Examples
port_power/TargetVer1.h, and port_power/TargetVer1b.h.

Definition at line 191 of file system.h.

◆ YARP_HAS_DLFCN_H

#define YARP_HAS_DLFCN_H

Definition at line 19 of file system.h.

◆ YARP_HAS_EXECINFO_H

#define YARP_HAS_EXECINFO_H

Definition at line 11 of file system.h.

◆ YARP_HAS_IFADDRS_H

#define YARP_HAS_IFADDRS_H

Definition at line 20 of file system.h.

◆ YARP_HAS_NETDB_H

#define YARP_HAS_NETDB_H

Definition at line 18 of file system.h.

◆ YARP_HAS_SIGNAL_H

#define YARP_HAS_SIGNAL_H

Definition at line 16 of file system.h.

◆ YARP_HAS_SYS_PRCTL_H

#define YARP_HAS_SYS_PRCTL_H

Definition at line 14 of file system.h.

◆ YARP_HAS_SYS_SIGNAL_H

#define YARP_HAS_SYS_SIGNAL_H

Definition at line 17 of file system.h.

◆ YARP_HAS_SYS_TYPES_H

#define YARP_HAS_SYS_TYPES_H

Definition at line 13 of file system.h.

◆ YARP_HAS_SYS_WAIT_H

#define YARP_HAS_SYS_WAIT_H

Definition at line 12 of file system.h.

◆ YARP_POINTER_SIZE

#define YARP_POINTER_SIZE   8

Definition at line 23 of file system.h.

◆ YARP_SUPPRESS_DLL_INTERFACE_WARNING

#define YARP_SUPPRESS_DLL_INTERFACE_WARNING

Suppress MSVC C4251 warning for the next line.

It should be used in this way:

static const std::string foo;
#define YARP_SUPPRESS_DLL_INTERFACE_WARNING
Suppress MSVC C4251 warning for the next line.
Definition: system.h:335
See also
YARP_DISABLE_DLL_INTERFACE_WARNING, YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG, YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARGS

Definition at line 335 of file system.h.

◆ YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG

#define YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG (   x)    x

Suppress MSVC C4251 warning for the declaration.

It should be used in this way:

#define YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG(x)
Suppress MSVC C4251 warning for the declaration.
Definition: system.h:336
Warning
As a side effect this macro suppresses the warning also for the following line.
See also
YARP_DISABLE_DLL_INTERFACE_WARNING, YARP_SUPPRESS_DLL_INTERFACE_WARNING, YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARGS

Definition at line 336 of file system.h.

◆ YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARGS

#define YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARGS (   ...)    __VA_ARGS__

Suppress MSVC C4251 warning for the declaration.

It should be used in this way:

#define YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARGS(...)
Suppress MSVC C4251 warning for the declaration.
Definition: system.h:337
Warning
As a side effect this macro suppresses the warning also for the following line.
This macro does not check the arguments, and it is therefore possible to write confusing declarations, it is recommended to use it only as suggested.
See also
YARP_DISABLE_DLL_INTERFACE_WARNING, YARP_SUPPRESS_DLL_INTERFACE_WARNING, YARP_SUPPRESS_DLL_INTERFACE_WARNING_ARG

Definition at line 337 of file system.h.

◆ YARP_WARNING_POP

#define YARP_WARNING_POP

Ends a temporary alteration of the enabled warnings.

See also
YARP_WARNING_PUSH

Definition at line 332 of file system.h.

◆ YARP_WARNING_PUSH

#define YARP_WARNING_PUSH

Starts a temporary alteration of the enabled warnings.

See also
YARP_WARNING_POP

Definition at line 331 of file system.h.