Hash :
e331531a
Author :
Date :
2025-05-22T19:33:05
stdckdint-h: Don't generate header if it is not needed. Suggested by Paul Eggert in: <https://lists.gnu.org/archive/html/bug-gnulib/2025-05/msg00216.html>. * m4/stdckdint_h.m4: New file. * modules/stdckdint-h (Files): Add m4/stdckdint_h.m4. (configure.ac): Remove checks and just invoke gl_STDCKDINT_H. (Makefile.am): Replace variables set by ./configure. * lib/stdckdint.in.h: Include the compilers header if it exists. Add comment mentioning expected future standardization in C++26. (ckd_add, ckd_sub, ckd_mul): Only define if the compilers definitions do not work.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
Description:
An <stdckdint.h> that is like C23.
Files:
m4/stdckdint_h.m4
lib/stdckdint.in.h
lib/intprops-internal.h
Depends-on:
gen-header
bool
configure.ac:
gl_STDCKDINT_H
gl_CONDITIONAL_HEADER([stdckdint.h])
AC_PROG_MKDIR_P
Makefile.am:
BUILT_SOURCES += $(STDCKDINT_H)
# We need the following in order to create <stdckdint.h> when the system
# doesn't have one that works with the given compiler.
if GL_GENERATE_STDCKDINT_H
stdckdint.h: stdckdint.in.h $(top_builddir)/config.status
@NMD@ $(AM_V_GEN)$(MKDIR_P) '%reldir%'
$(gl_V_at)$(SED_HEADER_STDOUT) \
-e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDCKDINT_H''@|$(NEXT_STDCKDINT_H)|g' \
-e 's|@''HAVE_C_STDCKDINT_H''@|$(HAVE_C_STDCKDINT_H)|g' \
-e 's|@''HAVE_WORKING_C_STDCKDINT_H''@|$(HAVE_WORKING_C_STDCKDINT_H)|g' \
-e 's|@''HAVE_CXX_STDCKDINT_H''@|$(HAVE_CXX_STDCKDINT_H)|g' \
-e 's|@''HAVE_WORKING_CXX_STDCKDINT_H''@|$(HAVE_WORKING_CXX_STDCKDINT_H)|g' \
$(srcdir)/stdckdint.in.h > $@-t
$(AM_V_at)mv $@-t $@
else
stdckdint.h: $(top_builddir)/config.status
rm -f $@
endif
MOSTLYCLEANFILES += stdckdint.h stdckdint.h-t
Include:
<stdckdint.h>
License:
LGPLv2+
Maintainer:
Paul Eggert