1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/lib/libast/sfio
Martijn Dekker 289dd46c05 build: include standards macros for all AST code (re: 7fb814e1)
Turns out that the standards macros set by features/standards (such
as _GNU_SOURCE for Linux or _DARWIN_SOURCE for macOS) were still
*not* included for most C source files! Instead, they were
selectively included for some files only, sometimes via
FEATURE/standards (the output of features/standards), sometimes
via ast_standards.h which is copied from FEATURE/standards.

Consequently, there were still inconsistencies in the system header
interfaces exposed on Linux, macOS, Solaris, et al. It's no wonder
it sometimes took so much hackery to keep everything building.

Of course, making this consistent had to break things somewhere.
Breakage occurred on 32-bit Linux due to a lot of ugly hackery
involving direct use of internal GNU types like off64_t and
functions like fseek64(). This is now all removed and they are
activated by setting the appropriate feature macro instead, so
these types and functions can be used with their standard names
(off_t, fseek, etc.)

Before committing I've tested these changes on the following
i386/x86_64 systems: Linux (glibc 32 and 64 bit, musl libc 64 bit),
Solaris (32 and 64 bit), illumos (32 and 64 bit), FreeBSD (64 bit),
macOS (64 bit), Cygwin (32 bit), and Haiku (64 bit).

(Note: ast_standards.h is copied from FEATURE/standards, whereas
ast_common.h is copied from FEATURE/common.)

src/lib/libast/include/ast_std.h,
src/lib/libast/stdio/stdhdr.h:
- Include <ast_standards.h> first. This should cause all the AST
  and dependent code (such as ksh) to get the standards macros.

src/lib/libast/features/standards:
- For GNU (glibc), #define _FILE_OFFSET_BITS 64 to get large file
  support with 64-bit offsets.
- Stop GNU and Cygwin <string.h> form defining the GNU version of
  basename(3); on Cygwin, that declaration conflicts with the AST
  version (and with POSIX) by using a const char* argument instead
  of char*. It is deactivated by defining the macro 'basename' (as
  'basename'); this causes GNU string.h to consider it to be
  already defined by the standard libgen.h header.

All other changed files:
- Remove direct use of *64* types and functions and a lot of
  related hackery.
2022-01-20 00:53:22 +00:00
..
_sfclrerr.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfdlen.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfeof.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sferror.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sffileno.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfgetc.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfgetl.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfgetl2.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfgetu.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfgetu2.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfllen.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfopen.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
_sfputc.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfputd.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfputl.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfputm.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfputu.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfslen.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfstacked.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfulen.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
_sfvalue.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfclose.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfclrlock.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfcvt.c Remove leftover pre-C89 code (re: a1f5c992) 2021-12-27 05:46:23 +00:00
sfdisc.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfdlen.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfecvt.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfexcept.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfextern.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sffcvt.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sffilbuf.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfflsbuf.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfgetd.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfgetl.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfgetm.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfgetr.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfgetu.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfhdr.h build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfllen.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfmode.c Fix various typos, man page issues and improve the documentation (#415) 2022-01-07 16:17:55 +00:00
sfmove.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfmutex.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfnew.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfnotify.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfnputc.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfopen.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfpeek.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfpkrd.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfpoll.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfpool.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfpopen.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfprintf.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfprints.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfpurge.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfputd.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfputl.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfputm.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfputr.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfputu.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfraise.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfrd.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfread.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfreserve.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfresize.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfscanf.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfseek.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfset.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfsetbuf.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfsetfd.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfsize.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfsk.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfstack.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfstrtod.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfstrtof.h INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfswap.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfsync.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sftable.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sftell.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sftmp.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfungetc.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfvprintf.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfvscanf.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfwalk.c INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
sfwr.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
sfwrite.c build: include standards macros for all AST code (re: 7fb814e1) 2022-01-20 00:53:22 +00:00
vthread.h Fix various typos, man page issues and improve the documentation (#415) 2022-01-07 16:17:55 +00:00