mirror of
https://git.savannah.gnu.org/git/gnulib.git
synced 2025-08-08 17:22:05 +03:00
stdbit-h, stdc_*: New modules, part of the stdbit module.
* lib/stdbit.in.h (_GL_STDC_*_INLINE): New macros. Enclose function definitions in #if @GL_STDC_*@ conditionals. * lib/stdc_leading_zeros.c: New file. * lib/stdc_leading_ones.c: New file. * lib/stdc_trailing_zeros.c: New file. * lib/stdc_trailing_ones.c: New file. * lib/stdc_first_leading_zero.c: New file. * lib/stdc_first_leading_one.c: New file. * lib/stdc_first_trailing_zero.c: New file. * lib/stdc_first_trailing_one.c: New file. * lib/stdc_count_zeros.c: New file. * lib/stdc_count_ones.c: New file, based on lib/stdbit.c. * lib/stdc_has_single_bit.c: New file. * lib/stdc_bit_width.c: New file. * lib/stdc_bit_floor.c: New file. * lib/stdc_bit_ceil.c: New file. * lib/stdbit.c (__gl_stdbit_popcount_support): Remove variable. * m4/stdbit_h.m4 (gl_STDBIT_H): Initialize GL_STDC_* variables. * modules/stdbit-h: New file, based on modules/stdbit. (Depends-on): Add gen-header. (Makefile.am): Substitute GL_STDC_* variables. * modules/stdc_leading_zeros: New file. * modules/stdc_leading_ones: New file. * modules/stdc_trailing_zeros: New file. * modules/stdc_trailing_ones: New file. * modules/stdc_first_leading_zero: New file. * modules/stdc_first_leading_one: New file. * modules/stdc_first_trailing_zero: New file. * modules/stdc_first_trailing_one: New file. * modules/stdc_count_zeros: New file. * modules/stdc_count_ones: New file. * modules/stdc_has_single_bit: New file. * modules/stdc_bit_width: New file. * modules/stdc_bit_floor: New file. * modules/stdc_bit_ceil: New file. * modules/stdbit: Change to a pure composition module. * modules/stdc_leading_zeros-tests: New file, based on modules/stdbit-tests. * modules/stdc_leading_ones-tests: New file, based on modules/stdbit-tests. * modules/stdc_trailing_zeros-tests: New file, based on modules/stdbit-tests. * modules/stdc_trailing_ones-tests: New file, based on modules/stdbit-tests. * modules/stdc_first_leading_zero-tests: New file, based on modules/stdbit-tests. * modules/stdc_first_leading_one-tests: New file, based on modules/stdbit-tests. * modules/stdc_first_trailing_zero-tests: New file, based on modules/stdbit-tests. * modules/stdc_first_trailing_one-tests: New file, based on modules/stdbit-tests. * modules/stdc_count_zeros-tests: New file, based on modules/stdbit-tests. * modules/stdc_count_ones-tests: New file, based on modules/stdbit-tests. * modules/stdc_has_single_bit-tests: New file, based on modules/stdbit-tests. * modules/stdc_bit_width-tests: New file, based on modules/stdbit-tests. * modules/stdc_bit_floor-tests: New file, based on modules/stdbit-tests. * modules/stdc_bit_ceil-tests: New file, based on modules/stdbit-tests. * modules/stdbit-tests: Remove file. * doc/posix-functions/stdc_leading_zeros.texi: Update. * doc/posix-functions/stdc_leading_ones.texi: Likewise. * doc/posix-functions/stdc_trailing_zeros.texi: Likewise. * doc/posix-functions/stdc_trailing_ones.texi: Likewise. * doc/posix-functions/stdc_first_leading_zero.texi: Likewise. * doc/posix-functions/stdc_first_leading_one.texi: Likewise. * doc/posix-functions/stdc_first_trailing_zero.texi: Likewise. * doc/posix-functions/stdc_first_trailing_one.texi: Likewise. * doc/posix-functions/stdc_count_zeros.texi: Likewise. * doc/posix-functions/stdc_count_ones.texi: Likewise. * doc/posix-functions/stdc_has_single_bit.texi: Likewise. * doc/posix-functions/stdc_bit_width.texi: Likewise. * doc/posix-functions/stdc_bit_floor.texi: Likewise. * doc/posix-functions/stdc_bit_ceil.texi: Likewise.
This commit is contained in:
58
modules/stdbit-h
Normal file
58
modules/stdbit-h
Normal file
@@ -0,0 +1,58 @@
|
||||
Description:
|
||||
A <stdbit.h> for platforms that lack it.
|
||||
|
||||
Files:
|
||||
lib/stdbit.in.h
|
||||
lib/stdbit.c
|
||||
m4/stdbit_h.m4
|
||||
|
||||
Depends-on:
|
||||
gen-header
|
||||
extern-inline [$GL_GENERATE_STDBIT_H]
|
||||
stdbool [$GL_GENERATE_STDBIT_H]
|
||||
|
||||
configure.ac:
|
||||
gl_STDBIT_H
|
||||
gl_CONDITIONAL_HEADER([stdbit.h])
|
||||
AC_PROG_MKDIR_P
|
||||
|
||||
Makefile.am:
|
||||
BUILT_SOURCES += $(STDBIT_H)
|
||||
|
||||
# We need the following in order to create <stdbit.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
if GL_GENERATE_STDBIT_H
|
||||
stdbit.h: stdbit.in.h $(top_builddir)/config.status
|
||||
@NMD@ $(AM_V_GEN)$(MKDIR_P) '%reldir%'
|
||||
$(gl_V_at)$(SED_HEADER_STDOUT) \
|
||||
-e 's/@''GL_STDC_LEADING_ZEROS''@/$(GL_STDC_LEADING_ZEROS)/g' \
|
||||
-e 's/@''GL_STDC_LEADING_ONES''@/$(GL_STDC_LEADING_ONES)/g' \
|
||||
-e 's/@''GL_STDC_TRAILING_ZEROS''@/$(GL_STDC_TRAILING_ZEROS)/g' \
|
||||
-e 's/@''GL_STDC_TRAILING_ONES''@/$(GL_STDC_TRAILING_ONES)/g' \
|
||||
-e 's/@''GL_STDC_FIRST_LEADING_ZERO''@/$(GL_STDC_FIRST_LEADING_ZERO)/g' \
|
||||
-e 's/@''GL_STDC_FIRST_LEADING_ONE''@/$(GL_STDC_FIRST_LEADING_ONE)/g' \
|
||||
-e 's/@''GL_STDC_FIRST_TRAILING_ZERO''@/$(GL_STDC_FIRST_TRAILING_ZERO)/g' \
|
||||
-e 's/@''GL_STDC_FIRST_TRAILING_ONE''@/$(GL_STDC_FIRST_TRAILING_ONE)/g' \
|
||||
-e 's/@''GL_STDC_COUNT_ZEROS''@/$(GL_STDC_COUNT_ZEROS)/g' \
|
||||
-e 's/@''GL_STDC_COUNT_ONES''@/$(GL_STDC_COUNT_ONES)/g' \
|
||||
-e 's/@''GL_STDC_HAS_SINGLE_BIT''@/$(GL_STDC_HAS_SINGLE_BIT)/g' \
|
||||
-e 's/@''GL_STDC_BIT_WIDTH''@/$(GL_STDC_BIT_WIDTH)/g' \
|
||||
-e 's/@''GL_STDC_BIT_FLOOR''@/$(GL_STDC_BIT_FLOOR)/g' \
|
||||
-e 's/@''GL_STDC_BIT_CEIL''@/$(GL_STDC_BIT_CEIL)/g' \
|
||||
$(srcdir)/stdbit.in.h > $@-t
|
||||
$(AM_V_at)mv $@-t $@
|
||||
lib_SOURCES += stdbit.c
|
||||
else
|
||||
stdbit.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += stdbit.h stdbit.h-t
|
||||
|
||||
Include:
|
||||
<stdbit.h>
|
||||
|
||||
License:
|
||||
LGPLv2+
|
||||
|
||||
Maintainer:
|
||||
all
|
Reference in New Issue
Block a user