#if !defined(__ErmPO_h__)
#define __ErmPO_h__
 
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
 
#include "PO_Ver.h"
 
/***************************************/
/**** Error macros (using ACPerror) ****/
/***************************************/
#define M_POFatalError(ErrorNum) \
{ \
 if (ErrorNum>E_uwPOFatalErr&&ErrorNum<E_uwPOStartOfWarning) \
 { \
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
  Erm_M_UpdateLastError(PO,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
 else \
 { \
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
  Erm_M_UpdateLastError(PO,C_ucErmDefaultChannel,E_uwPOFatalErrorNotAFatalError,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
}
 
#define M_POFatalErrorWithMessage(ErrorNum,Message) \
{ \
 if (ErrorNum>E_uwPOFatalErr&&ErrorNum<E_uwPOStartOfWarning) \
 { \
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
  Erm_M_UpdateLastError(PO,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, Message);\
 } \
 else \
 { \
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
  Erm_M_UpdateLastError(PO,C_ucErmDefaultChannel,E_uwPOFatalErrorNotAFatalError,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
}
 
#define M_POInformationError(ErrorNum) \
{ \
 if (ErrorNum>E_uwPOStartOfInformationWarning&&ErrorNum<E_uwPOErrNumber) \
 { \
  Erm_M_UpdateLastError(PO,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,g_stInternalGeneral.ucDisplayInformation,C_ucNeverStopForDebug, NULL);\
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
 } \
 else \
 { \
  M_POFatalError(E_uwPOInformationErrorIsNotAInformationError); \
 } \
}
 
#define M_POInformationErrorWithMessage(ErrorNum,Message) \
{ \
 if (ErrorNum>E_uwPOStartOfInformationWarning&&ErrorNum<E_uwPOErrNumber) \
 { \
  Erm_M_UpdateLastError(PO,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,g_stInternalGeneral.ucDisplayInformation,C_ucNeverStopForDebug, Message);\
  Erm_M_ClearLastError(C_ucErmDefaultChannel);\
 } \
 else \
 { \
  M_POFatalError(E_uwPOInformationErrorIsNotAInformationError); \
 } \
}
 
#define M_POWarningError(ErrorNum) \
{ \
 if (ErrorNum>E_uwPOStartOfWarning&&ErrorNum<E_uwPOStartOfInformationWarning) \
 { \
  Erm_M_UpdateLastError(PO,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
 } \
 else \
 { \
  M_POFatalError(E_uwPOWarningErrorIsNotAWarningError); \
 } \
}
 
#define M_POWarningErrorWithMessage(ErrorNum,Message) \
{ \
 if (ErrorNum>E_uwPOStartOfWarning&&ErrorNum<E_uwPOStartOfInformationWarning) \
 { \
  Erm_M_UpdateLastError(PO,C_ucErmDefaultChannel,ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, Message);\
 } \
 else \
 { \
  M_POFatalError(E_uwPOWarningErrorIsNotAWarningError); \
 } \
}
 
#define __FATAL_ERR_INPUT__
#define __INFORMATION_ERR_INPUT__ /**** Treat as a level 1 warning ****/
#define __WARNING_ERR_INPUT__     /**** Treat as a level 2 warning ****/
 
enum e_uwPOErrNumber
{
 E_uwPOFatalErr,
 #if defined(__FATAL_ERR_INPUT__)
 /**** Error's errors ****/
 E_uwPOFatalErrorNotAFatalError,
 E_uwPOInformationErrorIsNotAInformationError,
 E_uwPOWarningErrorIsNotAWarningError,
 #endif /*__FATAL_ERR_INPUT__*/
 
 E_uwPOStartOfWarning,
 
 #if defined(__WARNING_ERR_INPUT__)
 E_uwPOOctreeMustBeInFix,
 #endif /*__WARNING_ERR_INPUT__*/
 
 E_uwPOStartOfInformationWarning,
 
 #if defined(__INFORMATION_ERR_INPUT__)
 #endif /*__INFORMATION_ERR_INPUT__*/
 
	E_uwPOErrNumber,
};
 
/*------------------*/
/* Global Variables*/
/*------------------*/
#undef EXTERN
#undef extern
#undef LOCAL
#if !defined(D_PO_VariableDefine)
#define EXTERN extern /*external declaration*/
#define LOCAL /*replace by nothing : we have to declare*/
#else /* D_PO_VariableDefine */
#define EXTERN /*replace by nothing : we have to declare*/
#define LOCAL /*replace by nothing : we have to declare*/
#endif /* D_PO_VariableDefine */
 
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
EXTERN unsigned char g_ucPOModuleId /* number of identification of the Game module*/
#if defined(D_PO_VariableDefine)
= C_ucModuleNotInitialized
#endif /* D_PO_VariableDefine */
;
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
 
#if defined(__ERROR_STRINGS__)
 
EXTERN CPA_EXPORT char * g_a_szPOInformationModule []
#if defined(D_PO_VariableDefine) && !defined(CPA_WANTS_IMPORT)
= {C_szPOVersion, C_szPOFullName, C_szPODate}
#endif /* D_PO_VariableDefine &&  CPA_WANTS_IMPORT */
;
 
EXTERN char * g_szPOModuleName /* Obliged syntax 'sz'+[Abbreviation of ModuleName]+'ModuleName'*/
#if defined(D_PO_VariableDefine)
= {"PO"}
#endif /* D_PO_VariableDefine */
;
 
EXTERN tdstErrorMsg g_a_stPOTabErr[] /* Obliged syntax 'a_sz'+[Abbreviation of ModuleName]+'TabErr'*/
#if defined(D_PO_VariableDefine)
=
{
 #if defined(__FATAL_ERR_INPUT__)
 /**** Error's errors ****/
 E_uwPOFatalErrorNotAFatalError,"M_POFatalError : try to raise a warning or an information",
 E_uwPOInformationErrorIsNotAInformationError,"M_POInformationError : try to raise a fatal or a warning",
 E_uwPOWarningErrorIsNotAWarningError,"M_POWarningError : try to raise a fatal or a information",
 #endif /*__FATAL_ERR_INPUT__*/
 
 #ifdef __WARNING_ERR_INPUT__
 E_uwPOOctreeMustBeInFix,"CS_fn_eScriptCallBackGeneral : an fix geometrical have an octree in level (put the octree in fix)",
 #endif /*__WARNING_ERR_INPUT__*/
 
 #ifdef __INFORMATION_ERR_INPUT__
 #endif /*__INFORMATION_ERR_INPUT__*/
 
	0xffff,"\0"/*fin*/
}
#endif /* D_PO_VariableDefine */
;
#endif /* __ERROR_STRINGS__ */
 
#undef EXTERN
#undef extern
 
#endif /* !__ErmPO_h__ */
