#include <pthread.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <limits.h>
#include <errno.h>
#include <assert.h>
Include dependency graph for platform.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Namespaces | |
namespace | ucommon |
Defines | |
#define | __EXPORT |
#define | __LOCAL |
#define | __MALLOC |
#define | __PRINTF(x, y) |
#define | __SCANF(x, y) |
#define | __SHARED |
#define | _REENTRANT 1 |
#define | _THREADSAFE 1 |
#define | _UCOMMON_EXTENDED_ |
#define | crit(x, text) if(!(x)) cpr_runtime_error(text) |
#define | END_NAMESPACE } |
#define | EXTERN_C extern "C" |
#define | INVALID_HANDLE_VALUE -1 |
#define | INVALID_SOCKET -1 |
#define | NAMESPACE_EXTERN_C extern "C" { |
#define | NAMESPACE_UCOMMON namespace ucommon { |
#define | PROGRAM_EXIT(code) return code |
#define | PROGRAM_MAIN(argc, argv) extern "C" int main(int argc, char **argv) |
#define | SERVICE_MAIN(id, argc, argv) void service_##id(int argc, char **argv) |
#define | UCOMMON_ABI 6 |
#define | UCOMMON_NAMESPACE ucommon |
Typedefs | |
typedef void(*) | cpr_service_t (int argc, char **argv) |
typedef int | fd_t |
typedef long | Integer |
typedef double | Real |
typedef void(*) | sighandler_t (int) |
Convenient typedef for signal handlers. | |
typedef int | socket_t |
typedef unsigned long | timeout_t |
Typedef for millisecond timer values. | |
typedef unsigned long | Unsigned |
Functions | |
template<class T> | |
T * | init (T *memory) |
Template function to initialize memory by invoking default constructor. | |
void | strfree (char *str) |
Matching function for strdup(). |
This is used to support ucommon on different platforms. The ucommon library assumes at least a real posix threading library is present or will build thread support native on Microsoft Windows legacy platform. This header also deals with issues related to common base types.
Definition in file platform.h.
T* init | ( | T * | memory | ) | [inline] |
Template function to initialize memory by invoking default constructor.
If NULL is passed, then NULL is returned without any constructor called.
memory | to initialize. |
Definition at line 420 of file platform.h.
void strfree | ( | char * | str | ) | [inline] |
Matching function for strdup().
string | to release from allocated memory. |
Definition at line 431 of file platform.h.