Nugget
earesult.h
1 /*-----------------------------------------------------------------------------
2  * earesult.h
3  *
4  * Copyright (c) Electronic Arts Inc. All rights reserved.
5  *---------------------------------------------------------------------------*/
6 
7 
8 #ifndef INCLUDED_earesult_H
9 #define INCLUDED_earesult_H
10 
11 
12 #include <EABase/eabase.h>
13 
14 #if defined(EA_PRAGMA_ONCE_SUPPORTED)
15  #pragma once /* Some compilers (e.g. VC++) benefit significantly from using this. We've measured 3-4% build speed improvements in apps as a result. */
16 #endif
17 
18 
19 
20 /* This result type is width-compatible with most systems. */
21 typedef int32_t ea_result_type;
22 
23 
24 namespace EA
25 {
26  typedef int32_t result_type;
27 
28  enum
29  {
30 #ifndef SUCCESS
31  // Deprecated
32  // Note: a public MS header has created a define of this name which causes a build error. Fortunately they
33  // define it to 0 which is compatible.
34  // see: WindowsSDK\8.1.51641-fb\installed\Include\um\RasError.h
35  SUCCESS = 0,
36 #endif
37  // Deprecated
38  FAILURE = -1,
39 
40  // These values are now the preferred constants
41  EA_SUCCESS = 0,
42  EA_FAILURE = -1,
43  };
44 }
45 
46 
47 /* Macro to simplify testing for success. */
48 #ifndef EA_SUCCEEDED
49  #define EA_SUCCEEDED(result) ((result) >= 0)
50 #endif
51 
52 /* Macro to simplfify testing for general failure. */
53 #ifndef EA_FAILED
54  #define EA_FAILED(result) ((result) < 0)
55 #endif
56 
57 
58 #endif
59 
60 
61 
62