summaryrefslogtreecommitdiff
path: root/stdafx.h
diff options
context:
space:
mode:
authorAaron Staple <staple@cerie.counterpop.net>2009-04-27 16:51:35 -0700
committerAaron Staple <staple@cerie.counterpop.net>2009-04-27 16:51:35 -0700
commitce91c67c40e24c817214e1d71bb486d7831035da (patch)
treee0449d479d3772154eda2451858ddbeecacaf087 /stdafx.h
parentcc3887c8647f963d66f1fbcf7ba4b67acb43b03b (diff)
downloadmongo-ce91c67c40e24c817214e1d71bb486d7831035da.tar.gz
Revert "use static variables for OCCASIONALLY/RARELY/ONCE to get per function uniqueness"
This reverts commit cc3887c8647f963d66f1fbcf7ba4b67acb43b03b.
Diffstat (limited to 'stdafx.h')
-rw-r--r--stdafx.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/stdafx.h b/stdafx.h
index 5a635af39d9..70d3f934e15 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -299,13 +299,14 @@ namespace mongo {
#define DEBUGGING if( 0 )
- // The following declare one unique counter per enclosing function.
- // NOTE The implementation double-increments on a match, but we don't really care.
-#define SOMETIMES( occasion, howOften ) for( static unsigned occasion = 0; ++occasion % howOften == 0; )
-#define OCCASIONALLY SOMETIMES( occasionally, 16 )
-#define RARELY SOMETIMES( rarely, 128 )
-#define ONCE for( static bool undone = true; undone; undone = false )
-
+ extern unsigned occasion;
+ extern unsigned occasionR;
+ extern unsigned once;
+
+#define OCCASIONALLY if( ++occasion % 16 == 0 )
+#define RARELY if( ++occasionR % 128 == 0 )
+#define ONCE if( ++once == 1 )
+
#if defined(_WIN32)
#define strcasecmp _stricmp
inline void our_debug_free(void *p) {