]> Savannah Git Hosting - gnulib.git/commitdiff
Add more reminders to include <config.h>.
authorBruno Haible <bruno@clisp.org>
Thu, 13 Apr 2023 21:48:40 +0000 (23:48 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 13 Apr 2023 21:48:40 +0000 (23:48 +0200)
* lib/aligned-malloc.h: Check that config.h was already included.
* lib/careadlinkat.h: Likewise.
* lib/filemode.h: Likewise.
* lib/freadptr.h: Likewise.
* lib/fseterr.h: Likewise.
* lib/glthread/lock.h: Likewise.
* lib/glthread/tls.h: Likewise.
* lib/immutable.h: Likewise.
* lib/isapipe.h: Likewise.
* lib/isnand-nolibm.h: Likewise.
* lib/isnanf-nolibm.h: Likewise.
* lib/isnanl-nolibm.h: Likewise.
* lib/mbswidth.h: Likewise.
* lib/md5.h: Likewise.
* lib/minmax.h: Likewise.
* lib/msvc-inval.h: Likewise.
* lib/msvc-nothrow.h: Likewise.
* lib/pathmax.h: Likewise.
* lib/sha1.h: Likewise.
* lib/sha256.h: Likewise.
* lib/sha512.h: Likewise.
* lib/size_max.h: Likewise.
* lib/sm3.h: Likewise.
* lib/stat-size.h: Likewise.
* lib/termcap.h: Likewise.
* lib/terminfo.h: Likewise.
* lib/thread-optim.h: Likewise.
* lib/unlocked-io.h: Likewise.
* lib/vma-iter.h: Likewise.

30 files changed:
ChangeLog
lib/aligned-malloc.h
lib/careadlinkat.h
lib/filemode.h
lib/freadptr.h
lib/fseterr.h
lib/glthread/lock.h
lib/glthread/tls.h
lib/immutable.h
lib/isapipe.h
lib/isnand-nolibm.h
lib/isnanf-nolibm.h
lib/isnanl-nolibm.h
lib/mbswidth.h
lib/md5.h
lib/minmax.h
lib/msvc-inval.h
lib/msvc-nothrow.h
lib/pathmax.h
lib/sha1.h
lib/sha256.h
lib/sha512.h
lib/size_max.h
lib/sm3.h
lib/stat-size.h
lib/termcap.h
lib/terminfo.h
lib/thread-optim.h
lib/unlocked-io.h
lib/vma-iter.h

index c15d67bb262d7c31b6e49051d82d80329e0a2316..8a88a904fc892f3b22ac25103541a50202f939ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+2023-04-13  Bruno Haible  <bruno@clisp.org>
+
+       Add more reminders to include <config.h>.
+       * lib/aligned-malloc.h: Check that config.h was already included.
+       * lib/careadlinkat.h: Likewise.
+       * lib/filemode.h: Likewise.
+       * lib/freadptr.h: Likewise.
+       * lib/fseterr.h: Likewise.
+       * lib/glthread/lock.h: Likewise.
+       * lib/glthread/tls.h: Likewise.
+       * lib/immutable.h: Likewise.
+       * lib/isapipe.h: Likewise.
+       * lib/isnand-nolibm.h: Likewise.
+       * lib/isnanf-nolibm.h: Likewise.
+       * lib/isnanl-nolibm.h: Likewise.
+       * lib/mbswidth.h: Likewise.
+       * lib/md5.h: Likewise.
+       * lib/minmax.h: Likewise.
+       * lib/msvc-inval.h: Likewise.
+       * lib/msvc-nothrow.h: Likewise.
+       * lib/pathmax.h: Likewise.
+       * lib/sha1.h: Likewise.
+       * lib/sha256.h: Likewise.
+       * lib/sha512.h: Likewise.
+       * lib/size_max.h: Likewise.
+       * lib/sm3.h: Likewise.
+       * lib/stat-size.h: Likewise.
+       * lib/termcap.h: Likewise.
+       * lib/terminfo.h: Likewise.
+       * lib/thread-optim.h: Likewise.
+       * lib/unlocked-io.h: Likewise.
+       * lib/vma-iter.h: Likewise.
+
 2023-04-13  Bruno Haible  <bruno@clisp.org>
 
        Adjust comments in <config.h> reminders.
index cc938b608d71d84a7f713a4ceeb0681fc508d088..f05941f7e4e0610397d4ea04197de0f736742669 100644 (file)
    returned by memalign() can be freed, but it actually can be freed with
    free().  */
 
+/* This file uses MALLOC_ALIGNMENT, HAVE_POSIX_MEMALIGN, HAVE_ALIGNED_ALLOC,
+   HAVE_MEMALIGN.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #if !defined ALIGNMENT
 # error "ALIGNMENT is not defined"
 #endif
index 201d0415fff1ff375f0ead1ee66e790a489c062f..562cf013b757f53dd2bed8ae3a71633b7c792668 100644 (file)
 #ifndef _GL_CAREADLINKAT_H
 #define _GL_CAREADLINKAT_H
 
+/* This file uses HAVE_READLINKAT.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #include <fcntl.h>
 #include <unistd.h>
 
index 15a8dcc376034febf3a446d0914656c1afd21314..51e10053d295db40a09d1fcc7480a8646586e93a 100644 (file)
 
 #ifndef FILEMODE_H_
 
+/* This file uses HAVE_DECL_STRMODE.  */
+# if !_GL_CONFIG_H_INCLUDED
+#  error "Please include config.h first."
+# endif
+
 # include <sys/types.h>
 # include <sys/stat.h>
 
index 1f0f0f94f5b10223c0d0afb02c80f96973cbe512..a0fb3a4b7c8e0c4265c8475049b1a0cbc322f451 100644 (file)
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+/* This file uses HAVE___FREADPTR.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #include <stddef.h>
 #include <stdio.h>
 
index 0e9d2060aef03f5d85032ac801d911fd0b7adc16..87dc347332dc3e0816be41822c2f06004bb06057 100644 (file)
 #ifndef _FSETERR_H
 #define _FSETERR_H
 
+/* This file uses HAVE___FSETERR.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #include <stdio.h>
 
 /* Set the error indicator of the stream FP.
index ae3ee2d6718ddaec9513d180406059a6fd15f950..805cd1cf61d7dfeac31501f7f263dfec8842317b 100644 (file)
 #ifndef _LOCK_H
 #define _LOCK_H
 
+/* This file uses HAVE_THREADS_H, HAVE_PTHREAD_RWLOCK,
+   HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER,
+   PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
+   HAVE_PTHREAD_MUTEX_RECURSIVE.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #include <errno.h>
 #include <stdlib.h>
 
index aaaf0bb3b77cdd85c7b6314150f237640228af23..4788fae4f58e7bb6ffc0a1853aff64280d19e9c3 100644 (file)
 #ifndef _TLS_H
 #define _TLS_H
 
+/* This file uses HAVE_THREADS_H.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #include <errno.h>
 #include <stdlib.h>
 
index c76c625e31fc75e67ab5041a43ec55e27fd04224..6c5583261e3d707610e13b2253ceaac8285410ef 100644 (file)
    functions work alike, except that the "read-only" pointers are actually
    writable.  */
 
+/* This file uses HAVE_WORKING_MPROTECT.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #include <stddef.h>
 
 #ifdef __cplusplus
index 50a19c43b294e1018fb6da85a9c6dcf5ebed7d6b..1a3f9c7bbadce1c7f1629df74d77b716d8236b32 100644 (file)
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+/* This file uses HAVE_FIFO_PIPES.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 /* Whether pipes are FIFOs; -1 if not known.  */
 #ifndef HAVE_FIFO_PIPES
 # define HAVE_FIFO_PIPES (-1)
index 9c75a8c47bf1f699790e9610f7232ae590eec617..bb5a38b39f05c1b68dcafa7a058cb9e2ac287c42 100644 (file)
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+/* This file uses HAVE_ISNAND_IN_LIBC.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #if HAVE_ISNAND_IN_LIBC
 /* Get declaration of isnan macro.  */
 # include <math.h>
index cc6b4198ff1ef25e1422bff1c3cdbf8dd3ae54d3..f4bcba143e6349a013f9212ca226fc39f0e8571e 100644 (file)
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+/* This file uses HAVE_ISNANF_IN_LIBC.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #if HAVE_ISNANF_IN_LIBC
 /* Get declaration of isnan macro or (older) isnanf function.  */
 # include <math.h>
index f04c489bb8efdb141ee77bacc4142ea7a5b857ba..8becc5b409eb333d8553b5b46058734c7ed2dee7 100644 (file)
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+/* This file uses HAVE_ISNANL_IN_LIBC.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #if HAVE_ISNANL_IN_LIBC
 /* Get declaration of isnan macro or (older) isnanl function.  */
 # include <math.h>
index 5e4fc15b833fa1d2fee50e440fc6cf555bada4df..f385b649995227f64de2f56d17ef6936a2a6d9eb 100644 (file)
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
+/* This file uses HAVE_DECL_MBSWIDTH_IN_WCHAR_H.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #include <stddef.h>
 
 /* Avoid a clash of our mbswidth() with a function of the same name defined
index f34e7cb8dfa894e8351462ce1e8888d5a2ca0c40..92dc603898857a9c3d3c054517165da26ed60dad 100644 (file)
--- a/lib/md5.h
+++ b/lib/md5.h
 #ifndef _MD5_H
 #define _MD5_H 1
 
+/* This file uses HAVE_OPENSSL_MD5.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #include <stdio.h>
 #include <stdint.h>
 
index 1fbfc6616cff31b19dc6ccc5bc8f0da83036c7fe..0ac40198e24b7d4171b35ca065eb705624b11cfd 100644 (file)
    MIN, MAX macro redefinitions on some systems; the workaround is to
    #include this file as the last one among the #include list.  */
 
+/* This file uses HAVE_MINMAX_IN_LIMITS_H, HAVE_MINMAX_IN_SYS_PARAM_H.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 /* Before we define the following symbols we get the <limits.h> file
    since otherwise we get redefinitions on some systems if <limits.h> is
    included after this file.  Likewise for <sys/param.h>.
index ed00461ff70ddafc4519b4dc9c439a7ea62aa577..c16d8801789ede0f0d2ff6b130dfc3fe49d2c465 100644 (file)
        AC_DEFINE([MSVC_INVALID_PARAMETER_HANDLING], [SANE_LIBRARY_HANDLING])
  */
 
+/* This file uses HAVE_MSVC_INVALID_PARAMETER_HANDLER.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #define DEFAULT_HANDLING       0
 #define HAIRY_LIBRARY_HANDLING 1
 #define SANE_LIBRARY_HANDLING  2
index 82d3f6a2df4cc33cd46b080ef6e4df1fbd0be9de..0dd229fd661832402ff517ec530b2c4be5fea541 100644 (file)
    This file defines wrappers that turn such an invalid parameter notification
    into an error code.  */
 
+/* This file uses HAVE_MSVC_INVALID_PARAMETER_HANDLER.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #if defined _WIN32 && ! defined __CYGWIN__
 
 /* Get original declaration of _get_osfhandle.  */
index 0dd8f3bc5ce2bea0ae8064bdce05b58de0eae8bd..6930283b82a182654d5a3f277f3a90035bf9d21d 100644 (file)
          #endif
  */
 
+/* This file uses HAVE_SYS_PARAM_H.  */
+# if !_GL_CONFIG_H_INCLUDED
+#  error "Please include config.h first."
+# endif
+
 # include <unistd.h>
 
 # include <limits.h>
index 5a58b567ceb313e8275a5690758557eea84bff2c..854213a9211cf839283a8731592ec30ca85c8ac6 100644 (file)
 #ifndef SHA1_H
 # define SHA1_H 1
 
+/* This file uses HAVE_OPENSSL_SHA1.  */
+# if !_GL_CONFIG_H_INCLUDED
+#  error "Please include config.h first."
+# endif
+
 # include <stdio.h>
 # include <stdint.h>
 
index 2879477e89c494865ba452911900ca5f8a54c526..938b10670628124a059365145d538f6fe4902852 100644 (file)
 #ifndef SHA256_H
 # define SHA256_H 1
 
+/* This file uses HAVE_OPENSSL_SHA256.  */
+# if !_GL_CONFIG_H_INCLUDED
+#  error "Please include config.h first."
+# endif
+
 # include <stdio.h>
 # include <stdint.h>
 
index e3a98a2644c7250eec33e05baf54873ed07af22b..f3465bc8a6876a1d5c2d10129d63d8817a16f268 100644 (file)
 #ifndef SHA512_H
 # define SHA512_H 1
 
+/* This file uses HAVE_OPENSSL_SHA512.  */
+# if !_GL_CONFIG_H_INCLUDED
+#  error "Please include config.h first."
+# endif
+
 # include <stdio.h>
 # include "u64.h"
 
index 48af0250556618c6c459ab97a1a4df3122cdc985..2cfd31a59b86e80f2e4040735841d4e8d8c6b770 100644 (file)
 #ifndef GNULIB_SIZE_MAX_H
 #define GNULIB_SIZE_MAX_H
 
+/* This file uses HAVE_STDINT_H.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 /* Get SIZE_MAX declaration on systems like Solaris 7/8/9.  */
 # include <limits.h>
 /* Get SIZE_MAX declaration on systems like glibc 2.  */
index 4ca7f7a103acbb07ab676c59e1526779bad359cf..28af4dff1c5fc94c7de4901b2d845d84470c32b3 100644 (file)
--- a/lib/sm3.h
+++ b/lib/sm3.h
 #ifndef SM3_H
 # define SM3_H 1
 
+/* This file uses HAVE_OPENSSL_SM3.  */
+# if !_GL_CONFIG_H_INCLUDED
+#  error "Please include config.h first."
+# endif
+
 # include <stdio.h>
 # include <stdint.h>
 
index 48f0d3c35631eddb877c14dfad2463191847f3ca..bda00b7289b1dd3de37e280b488f70e435c78e85 100644 (file)
 #ifndef STAT_SIZE_H
 #define STAT_SIZE_H
 
+/* This file uses HAVE_SYS_PARAM_H, HAVE_STRUCT_STAT_ST_BLOCKS.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 /* sys/param.h may define DEV_BSIZE */
 #if HAVE_SYS_PARAM_H
 # include <sys/param.h>
index 93d78e2227c78633f36afa1caff77bfc79c7fbd3..f56543558a06d6d3be3fc420b7989d5cd321740f 100644 (file)
 #ifndef _TERMCAP_H
 #define _TERMCAP_H
 
+/* This file uses HAVE_TERMCAP, HAVE_TERMINFO, HAVE_TPARAM.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 /* Including <curses.h> or <term.h> is dangerous, because it also declares
    a lot of junk, such as variables PC, UP, and other.  */
 
index 0b6aacbb76c4925e0d50b160b8c805da01aa4c7c..eb0b3c855da373958d07d4267b7131731261fb88 100644 (file)
 #ifndef _TERMINFO_H
 #define _TERMINFO_H
 
+/* This file uses HAVE_TERMINFO, HAVE_TERMCAP, HAVE_TPARAM.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 /* Including <curses.h> or <term.h> is dangerous, because it also declares
    a lot of junk, such as variables PC, UP, and other.  */
 
index 9a4c80af3227feeeb6e228da1c5b6a5a6800be49..b5ef15aaf4990d8261b126b1025ed6d68a836225 100644 (file)
    same optimization cannot be applied to locks that synchronize different
    processes (e.g. through shared memory mappings).  */
 
+/* This file uses HAVE_SYS_SINGLE_THREADED_H.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #if HAVE_SYS_SINGLE_THREADED_H /* glibc >= 2.32 */
 # include <sys/single_threaded.h>
 # define gl_multithreaded()  (!__libc_single_threaded)
index fdef624ab9c29aa6ff5d753798dbb2d87cdf26bb..4830df4a7477af44d37bda82740d5fc77890c6fd 100644 (file)
    the *_unlocked functions directly.  On hosts that lack those
    functions, invoke the non-thread-safe versions instead.  */
 
+/* This file uses HAVE_DECL_*_UNLOCKED.  */
+# if !_GL_CONFIG_H_INCLUDED
+#  error "Please include config.h first."
+# endif
+
 # include <stdio.h>
 
 # if HAVE_DECL_CLEARERR_UNLOCKED || defined clearerr_unlocked
index d181184aee46d2398fb7c8d9721846b062879445..f89c8f032232562c7fc0c0c247a0b04b3f61e095 100644 (file)
 #ifndef _VMA_ITER_H
 #define _VMA_ITER_H
 
+/* This file uses HAVE_PSTAT_GETPROCVM, HAVE_MQUERY.  */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
 #include <stdint.h>
 
 #ifdef __cplusplus