UCommon
Namespaces | Defines | Typedefs | Functions
/usr/src/RPM/BUILD/ucommon-6.3.3/inc/ucommon/platform.h File Reference

Various miscellaneous platform specific headers and defines. More...

#include <pthread.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <cstdlib>
#include <cctype>
#include <climits>
#include <cerrno>
#include <new>
#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
 

Common namespace for all ucommon objects.


Defines

#define __EXPORT   __attribute__ ((visibility("default")))
#define __LOCAL   __attribute__ ((visibility("hidden")))
#define __SHARED   __attribute__ ((visibility("default")))
#define _UCOMMON_EXTENDED_
#define crit(x, text)   if(!(x)) cpr_runtime_error(text)
#define END_NAMESPACE   }
#define INVALID_HANDLE_VALUE   -1
#define INVALID_SOCKET   -1
#define NAMESPACE_UCOMMON   namespace ucommon {
#define UCOMMON_ABI   6
#define UCOMMON_NAMESPACE   ucommon

Typedefs

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().

Detailed Description

Various miscellaneous platform specific headers and defines.

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.


Typedef Documentation

typedef void(* sighandler_t)(int)

Convenient typedef for signal handlers.

Definition at line 337 of file platform.h.

typedef unsigned long timeout_t

Typedef for millisecond timer values.

Definition at line 339 of file platform.h.


Function Documentation

template<class T >
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.

Parameters:
memoryto initialize.
Returns:
memory initialized.

Definition at line 436 of file platform.h.

void strfree ( char *  str) [inline]

Matching function for strdup().

Parameters:
stringto release from allocated memory.

Definition at line 447 of file platform.h.