FreeNOS
Macros | Functions
Macros.h File Reference
#include "Types.h"

Go to the source code of this file.

Macros

#define TRUE   1
 Binary 1 means true.
 
#define FALSE   0
 Binary zero means false.
 
#define NULL   (void *)0
 NULL means zero.
 
#define ZERO   0
 Zero value.
 
#define QUOTE(x)    #x
 Stringfies the given input.
 
#define IQUOTE(x)    QUOTE(x)
 Indirect quoting.
 
#define KiloByte(v)   ((v) * 1024)
 Convert kilobytes to bytes.
 
#define MegaByte(v)   ((v) * 1024 * 1024)
 Convert megabytes to bytes.
 
#define GigaByte(v)   ((v) * 1024 * 1024 * 1024)
 Convert gigabytes to bytes.
 
#define LONG_MIN   -2147483647L
 Minimum value of an object of type long int.
 
#define LONG_MAX   2147483647L
 Maximum value of an object of type long int.
 
#define ULONG_MIN   0LU
 
#define ULONG_MAX   4294967295LU
 
#define INT_MIN   -2147483647
 
#define INT_MAX   2147483647
 
#define UINT_MIN   0U
 
#define UINT_MAX   4294967295U
 
#define CEIL(number, divisor)
 Calculate a division, and round to up any remaining.
 
#define offsetof(TYPE, MEMBER)    ((Size) &((TYPE *)0)->MEMBER)
 Calculates offsets in data structures.
 
#define C   "C"
 Used to define external C functions.
 
#define CPP
 
#define SECTION(s)    __attribute__((__section__(s)))
 Can be used to link a symbol inside a specific section.
 
#define USED    __attribute__((__used__))
 Declares an symbol to be forcibly "used".
 
#define PACKED    __attribute__((__packed__))
 Ensures strict minimum memory requirements.
 
#define ALIGN(n)    __attribute__((aligned(n)))
 Aligns a symbol at the given boundary.
 

Functions

bool isPowerOfTwo (unsigned number)
 Check if a number is power of two.
 
double doubleAbsolute (double number)
 Absolute value of a double.
 
bool doubleEquals (double a, double b, double epsilon)
 Compare two doubles using a epsilon number as precision indicator.