4343class RefCountClass ;
4444
4545
46- #ifndef NDEBUG
46+ #ifdef RTS_DEBUG
4747
4848struct ActiveRefStruct
4949{
@@ -59,7 +59,7 @@ struct ActiveRefStruct
5959#define NEW_REF ( C, P ) ( W3DNEW C P )
6060#define SET_REF_OWNER ( P ) P
6161
62- #endif
62+ #endif // RTS_DEBUG
6363
6464
6565/*
@@ -101,31 +101,31 @@ class RefCountClass
101101{
102102public:
103103
104- RefCountClass (void ) :
105- NumRefs (1 )
106- # ifndef NDEBUG
107- ,ActiveRefNode(this )
108- #endif
104+ RefCountClass (void )
105+ : NumRefs(1 )
106+ # ifdef RTS_DEBUG
107+ , ActiveRefNode(this )
108+ #endif
109109 {
110- # ifndef NDEBUG
110+ # ifdef RTS_DEBUG
111111 Add_Active_Ref (this );
112112 Inc_Total_Refs (this );
113- #endif
113+ #endif
114114 }
115115
116116 /*
117117 ** The reference counter value cannot be copied.
118118 */
119- RefCountClass (const RefCountClass & ) :
120- NumRefs (1 )
121- # ifndef NDEBUG
122- ,ActiveRefNode(this )
123- #endif
119+ RefCountClass (const RefCountClass & )
120+ : NumRefs(1 )
121+ # ifdef RTS_DEBUG
122+ , ActiveRefNode(this )
123+ #endif
124124 {
125- # ifndef NDEBUG
125+ # ifdef RTS_DEBUG
126126 Add_Active_Ref (this );
127127 Inc_Total_Refs (this );
128- #endif
128+ #endif
129129 }
130130
131131 RefCountClass& operator =(const RefCountClass&) { return *this ; }
@@ -134,24 +134,26 @@ class RefCountClass
134134 ** Add_Ref, call this function if you are going to keep a pointer
135135 ** to this object.
136136 */
137- #ifdef NDEBUG
138- WWINLINE void Add_Ref (void ) const { NumRefs++; }
139- #else
137+ #ifdef RTS_DEBUG
140138 void Add_Ref (void ) const ;
139+ #else
140+ WWINLINE void Add_Ref (void ) const { NumRefs++; }
141141#endif
142142
143143 /*
144144 ** Release_Ref, call this function when you no longer need the pointer
145145 ** to this object.
146146 */
147- WWINLINE void Release_Ref (void ) const {
148- #ifndef NDEBUG
149- Dec_Total_Refs (this );
150- #endif
151- NumRefs--;
152- WWASSERT (NumRefs >= 0 );
153- if (NumRefs == 0 ) const_cast <RefCountClass*>(this )->Delete_This ();
154- }
147+ WWINLINE void Release_Ref (void ) const
148+ {
149+ #ifdef RTS_DEBUG
150+ Dec_Total_Refs (this );
151+ #endif
152+ NumRefs--;
153+ WWASSERT (NumRefs >= 0 );
154+ if (NumRefs == 0 )
155+ const_cast <RefCountClass*>(this )->Delete_This ();
156+ }
155157
156158
157159 /*
@@ -180,9 +182,9 @@ class RefCountClass
180182 */
181183 virtual ~RefCountClass (void )
182184 {
183- # ifndef NDEBUG
185+ # ifdef RTS_DEBUG
184186 Remove_Active_Ref (this );
185- #endif
187+ #endif
186188 WWASSERT (NumRefs == 0 );
187189 }
188190
@@ -211,7 +213,7 @@ class RefCountClass
211213
212214public:
213215
214- #ifndef NDEBUG // Debugging stuff
216+ #ifdef RTS_DEBUG // Debugging stuff
215217
216218 /*
217219 ** Node in the Active Refs List
@@ -248,7 +250,7 @@ class RefCountClass
248250 */
249251 static bool Validate_Active_Ref (RefCountClass * obj);
250252
251- #endif // NDEBUG
253+ #endif // RTS_DEBUG
252254
253255};
254256
0 commit comments