17b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens/*!****************************************************************************
27b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens
37b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens @file         PVRTError.h
47b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens @copyright    Copyright (c) Imagination Technologies Limited.
57b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens @brief        PVRT error codes.
67b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens
77b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens******************************************************************************/
87b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens#ifndef _PVRTERROR_H_
97b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens#define _PVRTERROR_H_
107b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens
117b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens#if defined(ANDROID)
127b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens	#include <android/log.h>
137b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens#else
147b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens	#if defined(_WIN32)
157b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens		#include <windows.h>
167b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens	#else
177b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens		#include <stdio.h>
187b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens	#endif
197b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens#endif
207b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens/*!***************************************************************************
217b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens Macros
227b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens*****************************************************************************/
237b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens
247b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens/*! Outputs a string to the standard error if built for debugging. */
257b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens#if !defined(PVRTERROR_OUTPUT_DEBUG)
267b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens	#if defined(_DEBUG) || defined(DEBUG)
277b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens		#if defined(ANDROID)
287b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens			#define PVRTERROR_OUTPUT_DEBUG(A) __android_log_print(ANDROID_LOG_INFO, "PVRTools", A);
297b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens		#elif defined(_WIN32) && !defined(UNDER_CE)
307b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens			#define PVRTERROR_OUTPUT_DEBUG(A) OutputDebugStringA(A);
317b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens		#else
327b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens			#define PVRTERROR_OUTPUT_DEBUG(A) fprintf(stderr,A);
337b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens		#endif
347b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens	#else
357b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens		#define PVRTERROR_OUTPUT_DEBUG(A)
367b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens	#endif
377b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens#endif
387b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens
397b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens
407b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens/*!***************************************************************************
417b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens Enums
427b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens*****************************************************************************/
437b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens/*!***************************************************************************
447b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens @enum  			EPVRTError
457b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens @brief         	EPVRT error conditions.
467b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens*****************************************************************************/
477b21f276fa91ad62fd2055844688b07829f12205Nicolas Capensenum EPVRTError
487b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens{
497b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens	PVR_SUCCESS = 0,    /*!< Success! :D */
507b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens	PVR_FAIL = 1,       /*!< Failed :( */
517b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens	PVR_OVERFLOW = 2    /*!< Overflow error :| */
527b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens};
537b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens
547b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens/*!***************************************************************************
557b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens @brief     		Outputs a string to the standard error.
567b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens @param[in]			format		printf style format followed by arguments it requires.
577b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens*****************************************************************************/
587b21f276fa91ad62fd2055844688b07829f12205Nicolas Capensvoid PVRTErrorOutputDebug(char const * const format, ...);
597b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens
607b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens#endif // _PVRTERROR_H_
617b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens
627b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens/*****************************************************************************
637b21f276fa91ad62fd2055844688b07829f12205Nicolas CapensEnd of file (PVRTError.h)
647b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens*****************************************************************************/
657b21f276fa91ad62fd2055844688b07829f12205Nicolas Capens
66