Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


20cb5475279cb77026ea64472fc1e6fb323e1fb4
[palacios.git] / misc / network_servers / vtl / debug.h
1 #ifndef __DEBUG_H
2 #define __DEBUG_H 1
3
4
5
6
7 #ifdef DEBUG
8
9 #define ASSERT(exp) assert(exp)
10
11 /*
12  *
13  *
14  */
15
16 #ifdef linux
17
18 extern FILE * logfile;
19 extern time_t dbgt;
20 extern char dmsg[1024];
21
22 #define DEBUG_DECLARE() FILE * logfile; time_t dbgt; char dmsg[1024];
23 #define JRLDBG( ...) time(&dbgt); sprintf(dmsg,"%s: ",ctime(&dbgt)); *(dmsg + strlen(dmsg) -3) = ' '; fprintf(logfile, dmsg); sprintf(dmsg,__VA_ARGS__); fprintf(logfile,dmsg); fflush(logfile);
24 #define debug_init(logfilename) logfile = fopen(logfilename,"w+")
25
26 #elif defined(WIN32)
27
28 #define DEBUG_DECLARE() 
29 #define JRLDBG printf
30 #define debug_init(logfilename) 
31
32 #endif
33
34 /*
35  *
36  *
37  */
38
39 #else //!DEBUG
40
41 #ifdef WIN32
42
43 #define ASSERT(exp)
44 #define DEBUG_DECLARE()
45 #define JRLDBG()
46 #define debug_init(logfilename)
47
48 #elif defined(linux)
49
50 #define ASSERT(exp)
51 #define DEBUG_DECLARE(...)
52 #define JRLDBG(...)
53 #define debug_init(logfilename)
54
55 #endif
56
57 #endif
58
59
60
61 #endif