~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

Viewing changes to src/plugins/codecompletion/testing/preprocessors.cpp

  • Committer: damienlmoore at gmail
  • Date: 2016-02-02 02:43:22 UTC
  • Revision ID: damienlmoore@gmail.com-20160202024322-yql5qmtbwdyamdwd
Code::BlocksĀ 16.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <iostream>
 
2
 
 
3
// Note: Also don't forget to hover over #defines!
 
4
 
 
5
// CC for include statements:
 
6
//#include "nam
 
7
 
 
8
// ifdef / elif
 
9
#ifdef HAVE_STDIO
 
10
  #include <cstdio>
 
11
#elif HAVE_DUMMY
 
12
  #include <dummy>
 
13
#endif
 
14
 
 
15
// defines
 
16
#define MyConst   1
 
17
#define MyComm    /* a c-style comment */ 1
 
18
#define MyStr1    "this is a string"
 
19
#define MyStr2    "this is an \" escaped string"
 
20
#define MyStr3    "this is a string" /* short C style comment */
 
21
#define MyStr4    "this is a string" /* long multi-line
 
22
                                        C style comment */
 
23
#define MyComplex if (true) while (true) { break; } // a comment
 
24
#define MyMultiline while (true) \
 
25
                    { \
 
26
                      if (true) break; \
 
27
                    }
 
28
 
 
29
#if defined(__WXMOTIF__) || defined(__WXGTK__)
 
30
  #define wxSPECIAL1 wxID_OK | wxID_CANCEL
 
31
#else
 
32
  #define wxSPECIAL1
 
33
#endif
 
34
 
 
35
// nested
 
36
#define CONDITION_B   1
 
37
#define CONDITION_B_2 2
 
38
 
 
39
#if   CONDITION_A
 
40
  #if   CONDITION_A_1
 
41
    #define COND IS_A_1
 
42
  #elif CONDITION_A_2
 
43
    #define COND IS_A_2
 
44
  #endif
 
45
#elif CONDITION_B
 
46
  #if   CONDITION_B_1
 
47
    #define COND IS_B_1
 
48
  #elif CONDITION_B_2
 
49
    #define COND IS_B_2
 
50
  #endif
 
51
#endif
 
52
 
 
53
class MyClass1
 
54
{
 
55
  public:
 
56
           MyClass1() {};
 
57
  virtual ~MyClass1() {};
 
58
};
 
59
 
 
60
class MyClass2
 
61
{
 
62
  public:
 
63
           MyClass2() {};
 
64
  virtual ~MyClass2() {};
 
65
};
 
66
 
 
67
class AClass
 
68
#ifdef FOO
 
69
    : public MyClass1
 
70
    , public MyClass2
 
71
#endif
 
72
{
 
73
  public:
 
74
 
 
75
           AClass() {};
 
76
  virtual ~AClass() {};
 
77
 
 
78
  int   i_integer;
 
79
  float f_float;
 
80
};
 
81
 
 
82
#if 0
 
83
void a_function(int i_integer, float f_float)
 
84
{
 
85
}
 
86
#endif
 
87
 
 
88
#if defined(B_FUNCTION_ENABLED)
 
89
void b_function(int i_integer, float f_float)
 
90
{
 
91
}
 
92
#endif
 
93
 
 
94
int main (void)
 
95
{
 
96
//  HAVE
 
97
//  MyCon
 
98
//  MyCom
 
99
//  MyComp
 
100
//  MyMu
 
101
//  wxS
 
102
//  CON
 
103
}