Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / performance-tests / Misc / basic_func.h
blob987f4b6086bdacbc7cbe02c3afe3ca1815cf9630
2 //=============================================================================
3 /**
4 * @file basic_func.h
6 * For use with basic_perf.cpp.
8 * @author David Levine
9 */
10 //=============================================================================
13 #ifndef BASIC_FUNC_H
14 #define BASIC_FUNC_H
16 #include "ace/ACE.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 extern int A,BB,C,D,E,F;
24 // If your compiler optimizes away Empty_Iteration_Test::run (), then
25 // #defining ACE_HAS_OPTIMIZED_NULL_FUNCTIONS may help produce more
26 // reasonable numbers.
27 #if defined (_MSC_VER)
28 // MSVC 5.0 needs it . . .
29 # define ACE_HAS_OPTIMIZED_NULL_FUNCTIONS
30 #endif /* _MSC_VER */
32 #if defined (ACE_HAS_OPTIMIZED_NULL_FUNCTIONS)
33 # define EXPR(R,A,BB,C,D) (R=(A*BB + C*D))
34 # define DO_SOMETHING EXPR(A,BB,EXPR(F,A,E,C,BB),EXPR(BB,F,A,D,E),EXPR(E,BB,F,A,C));
35 #else /* ACE_HAS_OPTIMIZED_NULL_FUNCTIONS */
36 # define DO_SOMETHING
37 #endif /* ACE_HAS_OPTIMIZED_NULL_FUNCTIONS */
40 // An external (global) function.
41 void func ();
44 // A class with no virtual functions.
45 class Foo
47 public:
48 void inline_func () { DO_SOMETHING }
49 void func ();
53 // A class with a virtual function.
54 class Foo_v
56 public:
57 virtual ~Foo_v ();
58 void inline_func () { DO_SOMETHING }
59 void func ();
60 virtual void v_func ();
64 // A derived class.
65 class Foo_d_v : public Foo_v
67 public:
68 virtual void v_func ();
71 #endif /* BASIC_FUNC_H */