Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
35c4c802
Commit
35c4c802
authored
Oct 19, 2008
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to compile out the debugging code.
parent
428a68b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
util.h
util.h
+4
-2
No files found.
util.h
View file @
35c4c802
...
@@ -79,7 +79,10 @@ int daemonise(void);
...
@@ -79,7 +79,10 @@ int daemonise(void);
/* If debugging is disabled, we want to avoid calling format_address
/* If debugging is disabled, we want to avoid calling format_address
for every omitted debugging message. So debug is a macro. But
for every omitted debugging message. So debug is a macro. But
vararg macros are not portable. */
vararg macros are not portable. */
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
#if defined NO_DEBUG
static
void
ATTRIBUTE
((
used
))
debugf
(
const
char
*
format
,
...)
{
return
;
}
static
void
ATTRIBUTE
((
used
))
kdebugf
(
const
char
*
format
,
...)
{
return
;
}
#elif defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
#define debugf(...) \
#define debugf(...) \
do { \
do { \
if(debug >= 2) do_debugf(2, __VA_ARGS__); \
if(debug >= 2) do_debugf(2, __VA_ARGS__); \
...
@@ -98,7 +101,6 @@ int daemonise(void);
...
@@ -98,7 +101,6 @@ int daemonise(void);
if(debug >= 3) do_debugf(3, _args); \
if(debug >= 3) do_debugf(3, _args); \
} while(0)
} while(0)
#else
#else
/* Disable debugging code */
static
void
debugf
(
const
char
*
format
,
...)
{
return
;
}
static
void
debugf
(
const
char
*
format
,
...)
{
return
;
}
static
void
kdebugf
(
const
char
*
format
,
...)
{
return
;
}
static
void
kdebugf
(
const
char
*
format
,
...)
{
return
;
}
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment