lib/util: Include DEBUG macro in internal header files before samba_util.h
authorLukas Slebodnik <lslebodn@redhat.com>
Thu, 5 Mar 2015 10:26:46 +0000 (11:26 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 11 Mar 2015 17:47:22 +0000 (18:47 +0100)
commit9643a4b1ef2ada764f454ecc82aa6936217967fc
tree999d595854cb4efbba9f6d2d568ca39b55e74aa3
parentca598813808c7f06f248e78af302b966f5bbcd93
lib/util: Include DEBUG macro in internal header files before samba_util.h

It's best practice to include external header files before internal
header files. In this case internal DEBUG macro cannot be defined and
therefore samba version of debug macro will be included
in header file "util/fault.h".

In file included from example.c:27:0:
src/util/util.h:127:0: error: "DEBUG" redefined [-Werror]
 #define DEBUG(level, format, ...) do { \
 ^
In file included from /usr/include/samba-4.0/util/fault.h:29:0,
                 from /usr/include/samba-4.0/samba_util.h:62,
                 from /usr/include/samba-4.0/ndr.h:30,
                 from example.c:24:
/usr/include/samba-4.0/util/debug.h:182:0: note: this is the location of the previous definition
 #define DEBUG( level, body ) \
 ^
  CC       src/providers/ad/libsss_ad_common_la-ad_domain_info.lo
cc1: all warnings being treated as errors

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11033

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar 11 18:47:22 CET 2015 on sn-devel-104
lib/util/fault.h
lib/util/memcache.c
source3/include/includes.h
source4/include/includes.h