Skip to content

Commit

Permalink
Changing it from NOCHECKS to DOCHECKS
Browse files Browse the repository at this point in the history
  • Loading branch information
daveisfera committed Sep 3, 2012
1 parent 79acf3a commit 6048732
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ LIBS = -lpthread -lrt
all: test_mutex test_mutex_check

test_mutex: test_mutex.cpp
$(CXX) test_mutex.cpp -o test_mutex $(CXXFLAGS) $(LIBS) -DNOCHECKS=1
$(CXX) test_mutex.cpp -o test_mutex $(CXXFLAGS) $(LIBS)

test_mutex_check: test_mutex.cpp
$(CXX) test_mutex.cpp -o test_mutex_check $(CXXFLAGS) $(LIBS)
$(CXX) test_mutex.cpp -o test_mutex_check $(CXXFLAGS) $(LIBS) -DDOCHECKS=1

clean:
rm -f test_mutex test_mutex_check
8 changes: 4 additions & 4 deletions test_mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// NOTE: If you get linker errors about the atomic built-in functions (__sync_*),
// then add -march=i486 so that they will be included (not available for i386)
//
// Add -DNOCHECKS=1 to disable error checking.
// Add -DDOCHECKS=1 to enable error checking.

#include <semaphore.h>
#include <pthread.h>
Expand All @@ -23,9 +23,7 @@
#include <stdint.h>

// Prehistoric error checking for brevity
#if defined(NOCHECKS)
# define CHECK(condition) (void)(condition)
#else
#if defined(DOCHECKS)
# define CHECK(condition) \
do \
{ \
Expand All @@ -36,6 +34,8 @@
} \
} \
while (false)
#else
# define CHECK(condition) (void)(condition)
#endif

class mutex
Expand Down

0 comments on commit 6048732

Please sign in to comment.