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)
committerKarolin Seeger <kseeger@samba.org>
Mon, 20 Apr 2015 22:05:07 +0000 (00:05 +0200)
commit6135c950c4dbf3840a95fe48e5f0a3e7c752c599
tree06165420d88a87a763abe2971336e640c50460ba
parent6352ce70c1d2d3665c2929f4fc4bb313e771f1e2
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

(cherry picked from commit 9643a4b1ef2ada764f454ecc82aa6936217967fc)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Tue Apr 21 00:05:08 CEST 2015 on sn-devel-104
lib/util/fault.h
lib/util/memcache.c
source3/include/includes.h
source4/include/includes.h