/[pcsx2_0.9.7]/trunk/common/include/Pcsx2Defs.h
ViewVC logotype

Diff of /trunk/common/include/Pcsx2Defs.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 61 by william, Tue Sep 7 03:24:11 2010 UTC revision 62 by william, Tue Sep 7 11:08:22 2010 UTC
# Line 41  Line 41 
41  #       define ArraySize(x) (sizeof(x)/sizeof((x)[0]))  #       define ArraySize(x) (sizeof(x)/sizeof((x)[0]))
42  #endif  #endif
43    
44  //////////////////////////////////////////////////////////////////////////////////////////  // --------------------------------------------------------------------------------------
45  // __releaseinline -- a forceinline macro that is enabled for RELEASE/PUBLIC builds ONLY.  // jASSUME - give hints to the optimizer  [obsolete, use pxAssume() instead]
46  // This is useful because forceinline can make certain types of debugging problematic since  // --------------------------------------------------------------------------------------
 // functions that look like they should be called won't breakpoint since their code is  
 // inlined, and it can make stack traces confusing or near useless.  
 //  
 // Use __releaseinline for things which are generally large functions where trace debugging  
 // from Devel builds is likely useful; but which should be inlined in an optimized Release  
 // environment.  
 //  
 #ifdef PCSX2_DEVBUILD  
 #       define __releaseinline  
 #else  
 #       define __releaseinline __forceinline  
 #endif  
   
 //////////////////////////////////////////////////////////////////////////////////////////  
 // jASSUME - give hints to the optimizer  
47  //  This is primarily useful for the default case switch optimizer, which enables VC to  //  This is primarily useful for the default case switch optimizer, which enables VC to
48  //  generate more compact switches.  //  generate more compact switches.
49  //  //
# Line 83  Line 68 
68  #       endif  #       endif
69  #endif  #endif
70    
71  //////////////////////////////////////////////////////////////////////////////////////////  // --------------------------------------------------------------------------------------
72    //  C_ASSERT
73    // --------------------------------------------------------------------------------------
74  // compile-time assertion; usable at static variable define level.  // compile-time assertion; usable at static variable define level.
75  // (typically used to confirm the correct sizeof() for struct types where size  // (typically used to confirm the correct sizeof() for struct types where size
76  //  restaints must be enforced).  //  restaints must be enforced).
# Line 92  Line 79 
79  #       define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1]  #       define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1]
80  #endif  #endif
81    
82  //////////////////////////////////////////////////////////////////////////////////////////  // --------------------------------------------------------------------------------------
83  // Dev / Debug conditionals - Consts for using if() statements instead of uglier #ifdef.  // Dev / Debug conditionals - Consts for using if() statements instead of uglier #ifdef.
84  //  // --------------------------------------------------------------------------------------
85  // Note: Using if() optimizes nicely in Devel and Release builds, but will generate extra  // Note: Using if() optimizes nicely in Devel and Release builds, but will generate extra
86  // code overhead in debug builds (since debug neither inlines, nor optimizes out const-  // code overhead in debug builds (since debug neither inlines, nor optimizes out const-
87  // level conditionals).  Normally not a concern, but if you stick if( IsDevbuild ) in  // level conditionals).  Normally not a concern, but if you stick if( IsDevbuild ) in
# Line 134  Line 121 
121  #       define pxDebugCode(code)  #       define pxDebugCode(code)
122  #endif  #endif
123    
124    #ifdef PCSX2_DEVBUILD
125    #       define pxDevelCode(code)                code
126    #else
127    #       define pxDevelCode(code)
128    #endif
129    
130    #if !defined(PCSX2_DEBUG) && !defined(PCSX2_DEVEL)
131    #       define pxReleaseCode(code)
132    #else
133    #       define pxReleaseCode(code)              code
134    #endif
135    
136  //////////////////////////////////////////////////////////////////////////////////////////  // --------------------------------------------------------------------------------------
137  // __aligned / __aligned16 / __pagealigned  // __aligned / __aligned16 / __pagealigned
138  //  // --------------------------------------------------------------------------------------
139  // GCC Warning!  The GCC linker (LD) typically fails to assure alignment of class members.  // GCC Warning!  The GCC linker (LD) typically fails to assure alignment of class members.
140  // If you want alignment to be assured, the variable must either be a member of a struct  // If you want alignment to be assured, the variable must either be a member of a struct
141  // or a static global.  // or a static global.
# Line 156  Line 154 
154  #define PCSX2_PAGESIZE          0x1000  #define PCSX2_PAGESIZE          0x1000
155  static const int __pagesize     = PCSX2_PAGESIZE;  static const int __pagesize     = PCSX2_PAGESIZE;
156    
157  //////////////////////////////////////////////////////////////////////////////////////////  // --------------------------------------------------------------------------------------
158  // Structure Packing (__packed)  // Structure Packing (__packed)
159  //  // --------------------------------------------------------------------------------------
160  // Current Method:  // Current Method:
161  // Use a combination of embedded compiler-specific #pragma mess in conjunction with a  // Use a combination of embedded compiler-specific #pragma mess in conjunction with a
162  // __packed macro.  The former appeases the MSVC gods, the latter appeases the GCC gods.  // __packed macro.  The former appeases the MSVC gods, the latter appeases the GCC gods.
# Line 285  static const int __pagesize    = PCSX2_PAGE Line 283  static const int __pagesize    = PCSX2_PAGE
283  #endif          // end GCC-specific section.  #endif          // end GCC-specific section.
284    
285  #ifndef THE_UNBEARABLE_LIGHTNESS_OF_BEING_GCC_4_4_0  #ifndef THE_UNBEARABLE_LIGHTNESS_OF_BEING_GCC_4_4_0
286  #       define __nooptimization  #       define __nooptimization         // Pretty sure this is obsolete now, since we fixed __asm contraints and stuff. --air
287  #endif  #endif
288    
289    // --------------------------------------------------------------------------------------
290    // __releaseinline / __ri -- a forceinline macro that is enabled for RELEASE/PUBLIC builds ONLY.
291    // --------------------------------------------------------------------------------------
292    // This is useful because forceinline can make certain types of debugging problematic since
293    // functions that look like they should be called won't breakpoint since their code is
294    // inlined, and it can make stack traces confusing or near useless.
295    //
296    // Use __releaseinline for things which are generally large functions where trace debugging
297    // from Devel builds is likely useful; but which should be inlined in an optimized Release
298    // environment.
299    //
300    #ifdef PCSX2_DEVBUILD
301    #       define __releaseinline
302    #else
303    #       define __releaseinline __forceinline
304    #endif
305    
306    #define __ri    __releaseinline
307    #define __fi    __forceinline
308    
309    
310  #endif  #endif

Legend:
Removed from v.61  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.22