diff options
Diffstat (limited to 'ACE/examples/APG/Logging/Trace_Return.cpp')
-rw-r--r-- | ACE/examples/APG/Logging/Trace_Return.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/ACE/examples/APG/Logging/Trace_Return.cpp b/ACE/examples/APG/Logging/Trace_Return.cpp new file mode 100644 index 00000000000..1bb32a03456 --- /dev/null +++ b/ACE/examples/APG/Logging/Trace_Return.cpp @@ -0,0 +1,41 @@ +// $Id$ + +#include "Trace.h" + +#if defined (__GNUC__) && (__GNUC__ >= 3 || __GNUC_MINOR__ > 95) && \ + (!defined (VXWORKS) || !(__GNUC__ == 2 && __GNUC_MINOR__ == 96)) +// The DEBUG stuff only works with g++ 2.96 and later. +// But not with VxWorks g++ 2.96. + +// Listing 1 code/ch03 +void foo (void); + +int ACE_TMAIN (int, ACE_TCHAR *[]) +{ + TRACE ("main"); + + MY_DEBUG (ACE_TEXT ("Hi Mom\n")); + foo (); + MY_DEBUG (ACE_TEXT ("Goodnight\n")); + + TRACE_RETURN (0); +} + +void foo (void) +{ + TRACE ("foo"); + MY_DEBUG (ACE_TEXT ("Howdy Pardner\n")); + TRACE_RETURN_VOID (); +} +// Listing 1 + +#else +#include <stdio.h> + +int ACE_TMAIN (int, ACE_TCHAR *[]) +{ + puts ("This example only works on g++ 2.96 and later.\n"); + return 0; +} + +#endif /* __GNUC__ */ |