img_defs.h revision dc1209519284865899ca8d990b3a2c7dbca8ae08
1/* 2 * INTEL CONFIDENTIAL 3 * Copyright 2007 Intel Corporation. All Rights Reserved. 4 * Copyright 2005-2007 Imagination Technologies Limited. All Rights Reserved. 5 * 6 * The source code contained or described herein and all documents related to 7 * the source code ("Material") are owned by Intel Corporation or its suppliers 8 * or licensors. Title to the Material remains with Intel Corporation or its 9 * suppliers and licensors. The Material may contain trade secrets and 10 * proprietary and confidential information of Intel Corporation and its 11 * suppliers and licensors, and is protected by worldwide copyright and trade 12 * secret laws and treaty provisions. No part of the Material may be used, 13 * copied, reproduced, modified, published, uploaded, posted, transmitted, 14 * distributed, or disclosed in any way without Intel's prior express written 15 * permission. 16 * 17 * No license under any patent, copyright, trade secret or other intellectual 18 * property right is granted to or conferred upon you by disclosure or delivery 19 * of the Materials, either expressly, by implication, inducement, estoppel or 20 * otherwise. Any license under such intellectual property rights must be 21 * express and approved by Intel in writing. 22 */ 23 24/*!**************************************************************************** 25@File img_defs.h 26 27@Title Common header containing type definitions for portability 28 29@Author Imagination Technologies 30 31@date August 2001 32 33@Platform cross platform / environment 34 35@Description Contains variable and structure definitions. Any platform 36 specific types should be defined in this file. 37 38@DoxygenVer 39 40******************************************************************************/ 41 42/****************************************************************************** 43Modifications :- 44 45$Log: img_defs.h $ 46*****************************************************************************/ 47#if !defined (__IMG_DEFS_H__) 48#define __IMG_DEFS_H__ 49 50#include "img_types.h" 51 52/*! 53 ***************************************************************************** 54 * These types should be changed on a per-platform basis to retain 55 * the indicated number of bits per type. e.g.: A DP_INT_16 should be 56 * always reflect a signed 16 bit value. 57 *****************************************************************************/ 58 59typedef enum img_tag_TriStateSwitch { 60 IMG_ON = 0x00, 61 IMG_OFF, 62 IMG_IGNORE 63 64} img_TriStateSwitch, * img_pTriStateSwitch; 65 66#define IMG_SUCCESS 0 67#define IMG_FAILED -1 68 69#define IMG_NULL 0 70#define IMG_NO_REG 1 71 72#if defined (NO_INLINE_FUNCS) 73#define INLINE 74#define FORCE_INLINE 75#else 76#if defined(_UITRON_) 77#define INLINE 78#define FORCE_INLINE static 79#define INLINE_IS_PRAGMA 80#else 81#if defined (__cplusplus) 82#define INLINE inline 83#define FORCE_INLINE inline 84#else 85#define INLINE __inline 86#if defined(UNDER_CE) || defined(UNDER_XP) || defined(UNDER_VISTA) 87#define FORCE_INLINE __forceinline 88#else 89#define FORCE_INLINE static __inline 90#endif 91#endif 92#endif 93#endif 94 95/* Use this in any file, or use attributes under GCC - see below */ 96#ifndef PVR_UNREFERENCED_PARAMETER 97#define PVR_UNREFERENCED_PARAMETER(param) (param) = (param) 98#endif 99 100/* The best way to supress unused parameter warnings using GCC is to use a 101 * variable attribute. Place the unref__ between the type and name of an 102 * unused parameter in a function parameter list, eg `int unref__ var'. This 103 * should only be used in GCC build environments, for example, in files that 104 * compile only on Linux. Other files should use UNREFERENCED_PARAMETER */ 105#ifdef __GNUC__ 106#define unref__ __attribute__ ((unused)) 107#else 108#define unref__ 109#endif 110 111#if defined(UNDER_CE) 112 113/* This may need to be _stdcall */ 114#define IMG_CALLCONV 115#define IMG_INTERNAL 116#define IMG_RESTRICT 117 118#define IMG_EXPORT 119#define IMG_IMPORT IMG_EXPORT 120 121#ifdef DEBUG 122#define IMG_ABORT() TerminateProcess(GetCurrentProcess(), 0) 123#else 124#define IMG_ABORT() for(;;); 125#endif 126#else 127#if defined(_WIN32) 128 129#define IMG_CALLCONV __stdcall 130#define IMG_INTERNAL 131#define IMG_EXPORT __declspec(dllexport) 132#define IMG_RESTRICT __restrict 133 134 135/* IMG_IMPORT is defined as IMG_EXPORT so that headers and implementations match. 136 * Some compilers require the header to be declared IMPORT, while the implementation is declared EXPORT 137 */ 138#define IMG_IMPORT IMG_EXPORT 139#if defined( UNDER_VISTA ) && !defined(USE_CODE) 140#ifndef _INC_STDLIB 141void __cdecl abort(void); 142#endif 143__forceinline void __declspec(noreturn) img_abort(void) 144{ 145 for (;;) abort(); 146} 147#define IMG_ABORT() img_abort() 148#endif 149#else 150#if defined (__SYMBIAN32__) 151 152#if defined (__GNUC__) 153#define IMG_IMPORT 154#define IMG_EXPORT __declspec(dllexport) 155#define IMG_RESTRICT __restrict__ 156#define NONSHARABLE_CLASS(x) class x 157#else 158#if defined (__CC_ARM) 159#define IMG_IMPORT __declspec(dllimport) 160#define IMG_EXPORT __declspec(dllexport) 161#pragma warning("Please make sure that you've enabled the --restrict mode t") 162/* The ARMCC compiler currently requires that you've enabled the --restrict mode 163 to permit the use of this keyword */ 164# define IMG_RESTRICT /*restrict*/ 165#endif 166#endif 167 168#define IMG_CALLCONV 169#define IMG_INTERNAL 170#define IMG_EXTERNAL 171 172#else 173#if defined(__linux__) 174 175#define IMG_CALLCONV 176#define IMG_INTERNAL __attribute__ ((visibility ("hidden"))) 177#define IMG_EXPORT 178#define IMG_IMPORT 179#define IMG_RESTRICT __restrict__ 180 181#else 182#if defined(_UITRON_) 183#define IMG_CALLCONV 184#define IMG_INTERNAL 185#define IMG_EXPORT 186#define IMG_RESTRICT 187 188#define __cdecl 189 190/* IMG_IMPORT is defined as IMG_EXPORT so that headers and implementations match. 191* Some compilers require the header to be declared IMPORT, while the implementation is declared EXPORT 192*/ 193#define IMG_IMPORT IMG_EXPORT 194#ifndef USE_CODE 195void SysAbort(char const *pMessage); 196#define IMG_ABORT() SysAbort("ImgAbort") 197#endif 198#else 199#error("define an OS") 200#endif 201#endif 202#endif 203#endif 204#endif 205 206// Use default definition if not overridden 207#ifndef IMG_ABORT 208#define IMG_ABORT() abort() 209#endif 210 211 212#endif /* #if !defined (__IMG_DEFS_H__) */ 213/***************************************************************************** 214 End of file (IMG_DEFS.H) 215*****************************************************************************/ 216 217