summaryrefslogtreecommitdiff
path: root/usbmisc.c
diff options
context:
space:
mode:
authorNix <nix@esperi.org.uk>2010-07-01 21:05:59 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-12 15:34:52 -0700
commitd54d41370f04d9c0a4b6ce2cbb9c4cfc54031443 (patch)
tree04bed771cf0e965bc62f80739cb98641b934e06d /usbmisc.c
parent802f36044ed281c4082032ebf401ff6fc1625a0d (diff)
downloadusbutils-d54d41370f04d9c0a4b6ce2cbb9c4cfc54031443.tar.gz
Include config.h before everything else.
In a couple of cases, we fail to include config.h before all standard header files. As configure.ac specifies AC_SYS_LARGEFILE, config.h can define things like _FILE_OFFSET_BITS=64, which must be defined before all standard headers are included. Changing this in the middle of compilation confuses things like zlib, and can lead to compilation failures: In file included from names.c:42: /usr/include/32/zlib.h:1583: error: conflicting types for 'gzseek64' /usr/include/32/zlib.h:1567: note: previous declaration of 'gzseek64' was here /usr/include/32/zlib.h:1584: error: conflicting types for 'gztell64' /usr/include/32/zlib.h:1568: note: previous declaration of 'gztell64' was here /usr/include/32/zlib.h:1585: error: conflicting types for 'gzoffset64' /usr/include/32/zlib.h:1569: note: previous declaration of 'gzoffset64' was here /usr/include/32/zlib.h:1586: error: conflicting types for 'adler32_combine64' /usr/include/32/zlib.h:1570: note: previous declaration of 'adler32_combine64' was here /usr/include/32/zlib.h:1587: error: conflicting types for 'crc32_combine64' /usr/include/32/zlib.h:1571: note: previous declaration of 'crc32_combine64' was here make[1]: *** [lsusb-names.o] Error 1 The fix is to include it first. Signed-off-by: Nick Alcock <nix@esperi.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'usbmisc.c')
-rw-r--r--usbmisc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usbmisc.c b/usbmisc.c
index 1809210..f2c2732 100644
--- a/usbmisc.c
+++ b/usbmisc.c
@@ -23,13 +23,13 @@
/*****************************************************************************/
-#include <stdio.h>
-#include <string.h>
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include <stdio.h>
+#include <string.h>
+
#include "usbmisc.h"
/* ---------------------------------------------------------------------- */