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_TIME_SUPPORT         0
    00050 #define OSCL_HAS_MSWIN_PARTIAL_SUPPORT    0
    00051 #define OSCL_HAS_SYMBIAN_SUPPORT            0
    00052
    00053 // 64-bit int
    00054 #define OSCL_HAS_NATIVE_INT64_TYPE 1
    00055 #define OSCL_HAS_NATIVE_UINT64_TYPE 1
    00056 #define OSCL_NATIVE_INT64_TYPE     int64_t
    00057 #define OSCL_NATIVE_UINT64_TYPE    uint64_t
    00058 #define INT64(x) x##LL
    00059 #define UINT64(x) x##ULL
    00060 #define INT64_HILO(high,low) ((((high##LL))<<32)|low)
    00061 #define UINT64_HILO(high,low) ((((high##ULL))<<32)|low)
    00062
    00063 // character set.
    00064 #define OSCL_HAS_UNICODE_SUPPORT            1
    00065 #define OSCL_NATIVE_WCHAR_TYPE wchar_t
    00066 #if (OSCL_HAS_UNICODE_SUPPORT)
    00067 #define _STRLIT(x) L ## x
    00068 #else
    00069 #define _STRLIT(x) x
    00070 #endif
    00071 #define _STRLIT_CHAR(x) x
    00072 #define _STRLIT_WCHAR(x) L ## x
    00073
    00074 // Thread-local storage.  Unix has keyed TLS.
    00075 #define OSCL_HAS_TLS_SUPPORT    1
    00076 #define OSCL_TLS_IS_KEYED 1
    00077 typedef pthread_key_t TOsclTlsKey ;
    00078 #define OSCL_TLS_KEY_CREATE_FUNC(key) (pthread_key_create(&key,NULL)==0)
    00079 #define OSCL_TLS_KEY_DELETE_FUNC(key) pthread_key_delete(key)
    00080 #define OSCL_TLS_STORE_FUNC(key,ptr) (pthread_setspecific(key,(const void*)ptr)==0)
    00081 #define OSCL_TLS_GET_FUNC(key) pthread_getspecific(key)
    00082
    00083 //Basic lock
    00084 #define OSCL_HAS_BASIC_LOCK 1
    00085 #include <pthread.h>
    00086 typedef pthread_mutex_t TOsclBasicLockObject;
    00087
    00088 #endif // OSCLCONFIG_UNIX_COMMON_H_INCLUDED
    00089