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. More...
 
#define FALSE   0
 Binary zero means false. More...
 
#define NULL   (void *)0
 NULL means zero. More...
 
#define ZERO   0
 Zero value. More...
 
#define QUOTE(x)   #x
 Stringfies the given input. More...
 
#define IQUOTE(x)   QUOTE(x)
 Indirect quoting. More...
 
#define KiloByte(v)   ((v) * 1024)
 Convert kilobytes to bytes. More...
 
#define MegaByte(v)   ((v) * 1024 * 1024)
 Convert megabytes to bytes. More...
 
#define GigaByte(v)   ((v) * 1024 * 1024 * 1024)
 Convert gigabytes to bytes. More...
 
#define LONG_MIN   -2147483647L
 Minimum value of an object of type long int. More...
 
#define LONG_MAX   2147483647L
 Maximum value of an object of type long int. More...
 
#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. More...
 
#define offsetof(TYPE, MEMBER)   ((Size) &((TYPE *)0)->MEMBER)
 Calculates offsets in data structures. More...
 
#define C   "C"
 Used to define external C functions. More...
 
#define CPP
 
#define SECTION(s)   __attribute__((__section__(s)))
 Can be used to link a symbol inside a specific section. More...
 
#define USED   __attribute__((__used__))
 Declares an symbol to be forcibly "used". More...
 
#define PACKED   __attribute__((__packed__))
 Ensures strict minimum memory requirements. More...
 
#define ALIGN(n)   __attribute__((aligned(n)))
 Aligns a symbol at the given boundary. More...
 

Functions

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