Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# osclconfig_unix_common.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00003
    00004 //         O S C L C O N F I G _ U N I X _ C O M M O N
    00005
    00006 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
    00007
    00008
    00017 #ifndef OSCLCONFIG_UNIX_COMMON_H_INCLUDED
    00018 #define OSCLCONFIG_UNIX_COMMON_H_INCLUDED
    00019
    00020
    00021 // system header files
    00022 #include <stdlib.h> // abort
    00023 #include <stdarg.h> // va_list
    00024 #include <sys/types.h>
    00025 #include <stdio.h>
    00026 #include <wchar.h>
    00027 #include <string.h>
    00028 #include <unistd.h> //for sleep
    00029 #include <pthread.h>
    00030 #include <ctype.h> // for tolower and toupper
    00031 #ifdef __cplusplus
    00032 #include <new> //for placement new
    00033 #endif
    00034 #include <math.h>
    00035
    00036 #define OSCL_DISABLE_INLINES                0
    00037
    00038 #define OSCL_HAS_ANSI_STDLIB_SUPPORT        1
    00039 #define OSCL_HAS_ANSI_MATH_SUPPORT          1
    00040 #define OSCL_HAS_GLOBAL_VARIABLE_SUPPORT    1
    00041 #define OSCL_HAS_ANSI_STRING_SUPPORT        1
    00042 #define OSCL_HAS_ANSI_WIDE_STRING_SUPPORT   1
    00043 #define OSCL_HAS_ANSI_STDIO_SUPPORT         1
    00044
    00045 #define OSCL_MEMFRAG_PTR_BEFORE_LEN         1
    00046
    00047 #define OSCL_HAS_UNIX_SUPPORT               1
    00048 #define OSCL_HAS_MSWIN_SUPPORT              0
    00049 #define OSCL_HAS_MSWIN_PARTIAL_SUPPORT    0
    00050 #define OSCL_HAS_SYMBIAN_SUPPORT            0
    00051
    00052 // 64-bit int
    00053 #define OSCL_NATIVE_INT64_TYPE     int64_t
    00054 #define OSCL_NATIVE_UINT64_TYPE    uint64_t
    00055 #define INT64(x) x##LL
    00056 #define UINT64(x) x##ULL
    00057 #define INT64_HILO(high,low) ((((high##LL))<<32)|low)
    00058 #define UINT64_HILO(high,low) ((((high##ULL))<<32)|low)
    00059
    00060 // character set.
    00061 #define OSCL_HAS_UNICODE_SUPPORT            1
    00062 #define OSCL_NATIVE_WCHAR_TYPE wchar_t
    00063 #if (OSCL_HAS_UNICODE_SUPPORT)
    00064 #define _STRLIT(x) L ## x
    00065 #else
    00066 #define _STRLIT(x) x
    00067 #endif
    00068 #define _STRLIT_CHAR(x) x
    00069 #define _STRLIT_WCHAR(x) L ## x
    00070
    00071 // Thread-local storage.  Unix has keyed TLS.
    00072 #define OSCL_HAS_TLS_SUPPORT    1
    00073 #define OSCL_TLS_IS_KEYED 1
    00074 typedef pthread_key_t TOsclTlsKey ;
    00075 #define OSCL_TLS_KEY_CREATE_FUNC(key) (pthread_key_create(&key,NULL)==0)
    00076 #define OSCL_TLS_KEY_DELETE_FUNC(key) pthread_key_delete(key)
    00077 #define OSCL_TLS_STORE_FUNC(key,ptr) (pthread_setspecific(key,(const void*)ptr)==0)
    00078 #define OSCL_TLS_GET_FUNC(key) pthread_getspecific(key)
    00079
    00080 //Basic lock
    00081 #define OSCL_HAS_BASIC_LOCK 1
    00082 #include <pthread.h>
    00083 typedef pthread_mutex_t TOsclBasicLockObject;
    00084
    00085 #endif // OSCLCONFIG_UNIX_COMMON_H_INCLUDED
    00086