Gromacs
5.1
|
#include <stdint.h>
#include <inttypes.h>
Basic types and macros used throughout GROMACS.
Macros | |
#define | FALSE 0 |
False value for gmx_bool. More... | |
#define | TRUE 1 |
True value for gmx_bool. More... | |
#define | BOOL_NR 2 |
Number of gmx_bool values. More... | |
#define | gmx_inline inline |
Keyword to use in C code instead of C99 inline . More... | |
#define | gmx_restrict __restrict |
Keyword to use in instead of C99 restrict . More... | |
#define | gmx_cxx_const const |
Keyword to work around C/C++ differences in possible const keyword usage. More... | |
#define | gmx_unused |
Attribute to suppress compiler warnings about unused function parameters. More... | |
#define | __has_feature(x) 0 |
For compatibility with non-clang compilers. More... | |
#define | gmx_noreturn |
Indicate that a function is not expected to return. | |
#define | GMX_ALIGNMENT 0 |
Supports aligned variables. | |
#define | GMX_ALIGNED(type, alignment) |
Declare variable with data alignment. More... | |
#define | GMX_UNUSED_VALUE(value) (void)value |
Macro to explicitly ignore an unused value. | |
#define | GMX_IGNORE_RETURN_VALUE(call) ::gmx::internal::ignoreValueHelper(call) |
Macro to explicitly ignore a return value of a call. More... | |
Typedefs | |
typedef int | gmx_bool |
Boolean type for use in GROMACS C code. More... | |
Functions | |
template<typename T > | |
static void | gmx::internal::ignoreValueHelper (const T &) |
Helper for ignoring values in macros. More... | |
#define __has_feature | ( | x | ) | 0 |
For compatibility with non-clang compilers.
#define BOOL_NR 2 |
Number of gmx_bool values.
#define FALSE 0 |
False value for gmx_bool.
#define GMX_ALIGNED | ( | type, | |
alignment | |||
) |
Declare variable with data alignment.
[in] | type | Type of variable |
[in] | alignment | Alignment in multiples of type |
Typical usage:
#define gmx_cxx_const const |
Keyword to work around C/C++ differences in possible const keyword usage.
Some functions that do not modify their input parameters cannot declare those parameters as const
and compile warning/error-free on both C and C++ compilers because of differences in const
semantics. This macro can be used in cases where C++ allows const
, but C does not like it, to make the same declaration work for both.
#define gmx_inline inline |
Keyword to use in C code instead of C99 inline
.
Some of the C compilers we support do not recognize the C99 keyword inline
. This macro should be used in C code and in shared C/C++ headers to indicate a function is inlined. C++ code should use plain inline
, as that is already in C++98.
#define gmx_restrict __restrict |
Keyword to use in instead of C99 restrict
.
We cannot use restrict
because it is only in C99, but not in C++. This macro should instead be used to allow easily supporting different compilers.
#define gmx_unused |
Attribute to suppress compiler warnings about unused function parameters.
This attribute suppresses compiler warnings about unused function arguments by marking them as possibly unused. Some arguments are unused but have to be retained to preserve a function signature that must match that of another function. Some arguments are only used in some conditional compilation code paths (e.g. MPI).
#define TRUE 1 |
True value for gmx_bool.
typedef int gmx_bool |
Boolean type for use in GROMACS C code.
There is no standard size for 'bool' in C++, so when we previously defined it to int for C code the data types (and structs) would have different size depending on your compiler, both at GROMACS build time and when you use the library. The only way around this is to NOT assume anything about the C++ type, so we cannot use the name 'bool' in our C code anymore.