PVRTError.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*!****************************************************************************
  2. @file PVRTError.h
  3. @copyright Copyright (c) Imagination Technologies Limited.
  4. @brief PVRT error codes.
  5. ******************************************************************************/
  6. #ifndef _PVRTERROR_H_
  7. #define _PVRTERROR_H_
  8. #if defined(ANDROID)
  9. #include <android/log.h>
  10. #else
  11. #if defined(_WIN32)
  12. #include <windows.h>
  13. #else
  14. #include <stdio.h>
  15. #endif
  16. #endif
  17. /*!***************************************************************************
  18. Macros
  19. *****************************************************************************/
  20. /*! Outputs a string to the standard error if built for debugging. */
  21. #if !defined(PVRTERROR_OUTPUT_DEBUG)
  22. #if defined(_DEBUG) || defined(DEBUG)
  23. #if defined(ANDROID)
  24. #define PVRTERROR_OUTPUT_DEBUG(A) __android_log_print(ANDROID_LOG_INFO, "PVRTools", A);
  25. #elif defined(_WIN32) && !defined(UNDER_CE)
  26. #define PVRTERROR_OUTPUT_DEBUG(A) OutputDebugStringA(A);
  27. #else
  28. #define PVRTERROR_OUTPUT_DEBUG(A) fprintf(stderr,"%s",A);
  29. #endif
  30. #else
  31. #define PVRTERROR_OUTPUT_DEBUG(A)
  32. #endif
  33. #endif
  34. /*!***************************************************************************
  35. Enums
  36. *****************************************************************************/
  37. /*!***************************************************************************
  38. @enum EPVRTError
  39. @brief EPVRT error conditions.
  40. *****************************************************************************/
  41. enum EPVRTError
  42. {
  43. PVR_SUCCESS = 0, /*!< Success! :D */
  44. PVR_FAIL = 1, /*!< Failed :( */
  45. PVR_OVERFLOW = 2 /*!< Overflow error :| */
  46. };
  47. /*!***************************************************************************
  48. @brief Outputs a string to the standard error.
  49. @param[in] format printf style format followed by arguments it requires.
  50. *****************************************************************************/
  51. void PVRTErrorOutputDebug(char const * const format, ...);
  52. #endif // _PVRTERROR_H_
  53. /*****************************************************************************
  54. End of file (PVRTError.h)
  55. *****************************************************************************/