Panel plugin development

Alexis BRENON @Xfce brenon.alexis+xfce at gmail.com
Fri Apr 5 22:08:55 CEST 2019


> > One thing you could try to troubleshoot is to put the following at the
> > very top, before all other code, in any files where the `DBG()` macro
> > isn't working:
> >
> > ```
> > #define DEBUG 1
> > #include <libxfce4util/libxfce4util.h>
> > #ifndef DBG
> > # error "uh oh!"
> > #endif
> > ```

With this snippet, the DBG calls display the message (as intented).
Removing the first line (#define DEBUG 1) make DBG call like NOOP ;
there is no error at compile nor run time (as DBG macro should be
defined) but it must be defined to a NOOP...

>
> Or maybe something like this:
>
> ```
> #undef DEBUG
> #define DEBUG 1
> #include <libxfce4util/libxfce4util.h>
> #if !defined(DEBUG) || DEBUG != 1
> # error "DEBUG macro was changed"
> #endif
> #ifndef DBG
> # error "DBG macro did not get defined"
> #endif
> ```

No compilation error with this one, and DBG messages are displayed.
Removing first two lines make a compilation error: DEBUG macro was
changed (actually it is not define, neither by me or the include).

Alexis


More information about the Xfce4-dev mailing list