[Tuxnes-devel] another compile cleanup: config.h
Brought to you by:
tmmm
From: Jason D. S. <jd...@us...> - 2004-02-18 19:58:55
|
I get this problem when compiling: sound.c:503: warning: implicit declaration of function `ioctl' because #include <ioctl.h> is surrounded by #ifdef HAVE_IOCTL_H, but there is no #include <config.h> in the file. This patch changes all files to have #ifdef HAVE_CONFIG_H # include <config.h> #endif /* HAVE_CONFIG_H */ in them. Important points: - It must be before any other #includes, even system includes. For instance assert.h defines assert() differently depending on the value of NDEBUG, which is generally defined in config.h (see ziploader.c). - There's no need to have #include <config.h> in .h files. It might be possible that this breaks things (by including it twice); I don't know. Anyway, I removed it. - You're supposed to use <config.h>, not "config.h". I don't know why, or if it matters. - You're supposed to use #ifdef HAVE_CONFIG_H to surround it. I don't know why, or if it matters. The latter two are probably to help compilation on some bizarre systems that don't have autoconf. Who knows. jason |