• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 // -*- c++ -*-
19 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
20 
21 //         O S C L C O N F I G _ U N I X _ C O M M O N
22 
23 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
24 
25 
26 /*! \file osclconfig_limits_typedefs.h
27  *  \brief This file contains common typedefs based on the ANSI C limits.h header
28  *
29  *  This header file should work for any ANSI C compiler to determine the
30  *  proper native C types to use for OSCL integer types.
31  */
32 
33 
34 #ifndef OSCLCONFIG_UNIX_COMMON_H_INCLUDED
35 #define OSCLCONFIG_UNIX_COMMON_H_INCLUDED
36 
37 
38 // system header files
39 #include <stdlib.h> // abort
40 #include <stdarg.h> // va_list
41 #include <sys/types.h>
42 #include <stdio.h>
43 #include <wchar.h>
44 #include <string.h>
45 #include <unistd.h> //for sleep
46 #include <pthread.h>
47 #include <ctype.h> // for tolower and toupper
48 #ifdef __cplusplus
49 #include <new> //for placement new
50 #endif
51 #include <math.h>
52 
53 #define OSCL_DISABLE_INLINES                0
54 
55 #define OSCL_HAS_ANSI_STDLIB_SUPPORT        1
56 #define OSCL_HAS_ANSI_MATH_SUPPORT          1
57 #define OSCL_HAS_GLOBAL_VARIABLE_SUPPORT    1
58 #define OSCL_HAS_ANSI_STRING_SUPPORT        1
59 #define OSCL_HAS_ANSI_WIDE_STRING_SUPPORT   1
60 #define OSCL_HAS_ANSI_STDIO_SUPPORT         1
61 
62 #define OSCL_MEMFRAG_PTR_BEFORE_LEN         1
63 
64 #define OSCL_HAS_UNIX_SUPPORT               1
65 #define OSCL_HAS_MSWIN_SUPPORT              0
66 #define OSCL_HAS_SYMBIAN_SUPPORT            0
67 
68 // 64-bit int
69 #define OSCL_HAS_NATIVE_INT64_TYPE 1
70 #define OSCL_HAS_NATIVE_UINT64_TYPE 1
71 #define OSCL_NATIVE_INT64_TYPE     int64_t
72 #define OSCL_NATIVE_UINT64_TYPE    uint64_t
73 #define INT64(x) x##LL
74 #define UINT64(x) x##ULL
75 #define INT64_HILO(high,low) ((((high##LL))<<32)|low)
76 #define UINT64_HILO(high,low) ((((high##ULL))<<32)|low)
77 
78 // character set.
79 #define OSCL_HAS_UNICODE_SUPPORT            1
80 #define OSCL_NATIVE_WCHAR_TYPE wchar_t
81 #if (OSCL_HAS_UNICODE_SUPPORT)
82 #define _STRLIT(x) L ## x
83 #else
84 #define _STRLIT(x) x
85 #endif
86 #define _STRLIT_CHAR(x) x
87 #define _STRLIT_WCHAR(x) L ## x
88 
89 // Thread-local storage.  Unix has keyed TLS.
90 #define OSCL_HAS_TLS_SUPPORT    1
91 #define OSCL_TLS_IS_KEYED 1
92 typedef pthread_key_t TOsclTlsKey ;
93 #define OSCL_TLS_KEY_CREATE_FUNC(key) (pthread_key_create(&key,NULL)==0)
94 #define OSCL_TLS_KEY_DELETE_FUNC(key) pthread_key_delete(key)
95 #define OSCL_TLS_STORE_FUNC(key,ptr) (pthread_setspecific(key,(const void*)ptr)==0)
96 #define OSCL_TLS_GET_FUNC(key) pthread_getspecific(key)
97 
98 //Basic lock
99 #define OSCL_HAS_BASIC_LOCK 1
100 #include <pthread.h>
101 typedef pthread_mutex_t TOsclBasicLockObject;
102 
103 #endif // OSCLCONFIG_UNIX_COMMON_H_INCLUDED
104 
105