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 19 #ifndef OSCLCONFIG_PROC_CHECK_H_INCLUDED 20 #define OSCLCONFIG_PROC_CHECK_H_INCLUDED 21 22 /** 23 OSCL_HAS_THREAD_SUPPORT macro should be set to 1 if 24 the target platform supports threads. 25 Otherwise it should be set to 0. 26 */ 27 #ifndef OSCL_HAS_THREAD_SUPPORT 28 #error "ERROR: OSCL_HAS_THREAD_SUPPORT has to be defined to either 1 or 0" 29 #endif 30 31 /** 32 OSCL_HAS_NON_PREEMPTIVE_THREAD_SUPPORT macro should be set to 1 if 33 the target platform supports non-pre-emptive threads. 34 Otherwise it should be set to 0. 35 */ 36 #ifndef OSCL_HAS_NON_PREEMPTIVE_THREAD_SUPPORT 37 #error "ERROR: OSCL_HAS_NON_PREEMPTIVE_THREAD_SUPPORT has to be defined to either 1 or 0" 38 #endif 39 40 /** 41 OSCL_HAS_SYMBIAN_SCHEDULER macro should be set to 1 if 42 the target platform supports Symbian active object scheduler. 43 Otherwise it should be set to 0. 44 */ 45 #ifndef OSCL_HAS_SYMBIAN_SCHEDULER 46 #error "ERROR: OSCL_HAS_SYMBIAN_SCHEDULER has to be defined to either 1 or 0" 47 #endif 48 49 /** 50 OSCL_HAS_SEM_TIMEDWAIT_SUPPORT macro should be set to 1 if 51 the target platform supports POSIX-compliant semaphores (semaphore.h) 52 with advanced realtime features including sem_timedwait. 53 Otherwise it should be set to 0. 54 */ 55 #ifndef OSCL_HAS_SEM_TIMEDWAIT_SUPPORT 56 #error "ERROR: OSCL_HAS_SEM_TIMEDWAIT_SUPPORT has to be defined to either 1 or 0" 57 #endif 58 59 /** 60 OSCL_HAS_PTHREAD_SUPPORT macro should be set to 1 if 61 the target platform supports POSIX-compliand pthreads (pthread.h). 62 Otherwise it should be set to 0. 63 */ 64 #ifndef OSCL_HAS_PTHREAD_SUPPORT 65 #error "ERROR: OSCL_HAS_PTHREAD_SUPPORT has to be defined to either 1 or 0" 66 #endif 67 68 /** 69 type TOsclThreadId should be defined as the type used as 70 a thread ID 71 on the target platform. 72 Example: 73 typedef DWORD TOsclThreadId; 74 */ 75 typedef TOsclThreadId __verify__TOsclThreadId__defined__; 76 77 /** 78 type TOsclThreadFuncRet should be defined as the type used as 79 a thread function return value 80 on the target platform. 81 Example: 82 typedef DWORD TOsclThreadFuncRet; 83 */ 84 typedef TOsclThreadFuncRet __verify__TOsclThreadFuncRet__defined__; 85 86 /** 87 type TOsclThreadFuncArg should be defined as the type used as 88 a thread function argument 89 on the target platform. 90 Example: 91 typedef LPVOID TOsclThreadFuncArg; 92 */ 93 typedef TOsclThreadFuncArg __verify__TOsclThreadFuncArg__defined__; 94 95 /** 96 OSCL_THREAD_DECL macro should be defined to the 97 necessary function declaration modifiers for thread routines, 98 or a null macro if no modifiers are needed. 99 Example: 100 #define OSCL_THREAD_DECL WINAPI 101 */ 102 #ifndef OSCL_THREAD_DECL 103 #error "ERROR: OSCL_THREAD_DECL has to be defined." 104 #endif 105 106 /** 107 Example of a declaration of a thread routine called MyThreadMain using 108 the Oscl definitions: 109 110 static TOsclThreadFuncRet OSCL_THREAD_DECL MyThreadMain(TOsclThreadFuncArg arg); 111 */ 112 113 /** 114 type TOsclThreadObject should be defined as the type used as 115 a thread object or handle 116 on the target platform. 117 Example: 118 typedef pthread_t TOsclThreadObject; 119 */ 120 typedef TOsclThreadObject __verify__TOsclThreadObject__defined__; 121 122 /** 123 type TOsclMutexObject should be defined as the type used as 124 a mutex object or handle 125 on the target platform. 126 Example: 127 typedef pthread_mutex_t TOsclMutexObject; 128 */ 129 typedef TOsclMutexObject __verify__TOsclMutexObject__defined__; 130 131 /** 132 type TOsclSemaphoreObject should be defined as the type used as 133 a mutex object or handle 134 on the target platform. 135 Example: 136 typedef sem_t TOsclSemaphoreObject; 137 */ 138 typedef TOsclSemaphoreObject __verify__TOsclSemaphoreObject__defined__; 139 140 /** 141 type TOsclConditionObject should be defined as the type used as 142 a condition variable 143 on the target platform. 144 Example: 145 typedef pthread_cond_t TOsclConditionObject; 146 147 Note: Condition variables are only used with certain semaphore implementations. 148 If the semaphore implementation does not require a condition variable, 149 then this type can be defined as 'int' as follows: 150 typedef int TOsclConditionObject; //not used 151 */ 152 typedef TOsclConditionObject __verify__TOsclConditionObject__defined__; 153 154 155 #endif //OSCLCONFIG_PROC_CHECK_H_INCLUDED 156 157 158