1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-04 23:35:36 -08:00
Commit Graph

26 Commits

Author SHA1 Message Date
jca
0967fc9724 Move ctype.h defines to the _CTYPE_ prefix, avoids clashes with identifiers in ports
Even if those _[BCNLPSUX] defines are in the reserved namespace, some
ports make use of those identifiers and thus need pointless
headscratching and patches.  Just use a longer reserved prefix.
We can't just #undef those defines as they are used in libc.

Change similar to what NetBSD did around 2010.  Went through base builds
and an amd64 bulk build, the only fallout was lib(e)stdc++ base_ctype.h.
"make includes" will install the latest ctype.h and libstdc++ ctype_base.h.

"makes sense" deraadt@, ok sthen@ tb@
2024-02-04 13:03:18 +00:00
schwarze
3a628b46e7 New POSIX xlocale implementation written from scratch.
Complete in the sense that all POSIX *locale(3) and *_l(3) functions
are included, but in OpenBSD, we of course only really care about
LC_CTYPE and we only support ASCII and UTF-8.

With important help from kettenis@, guenther@, and jca@.
Repeated testing in ports bulk builds by naddy@.
Additional testing by jca@, sebastia@, dcoppa@, and others.
OK kettenis@ dcoppa@, and guenther@ on an earlier version.
Riding guenther@'s libc/librthread major bump.
2017-09-05 03:16:13 +00:00
guenther
6ffa79183a Can't use a variable 'c' in a standard include; rename it to '_c'
ok deraadt@ millert@
2014-05-26 01:49:36 +00:00
guenther
acf82b0a9d lint is dead (long live the lint!), so stop using it as a cpp conditional
(namespace pollution!) or talking about its opinion on code.

ok krw@
2014-03-16 18:38:30 +00:00
guenther
2095efaf70 Now that __only_inline is in <sys/cdefs.h>, replace the local versions in
<ctype.h> and <signal.h>

ok kettenis@ millert@ deraadt@
2010-10-01 20:10:24 +00:00
kettenis
9add5cdd9c When using GCC, we always want GNU inline semantics. Fixes issues with
-Wsystem-headers and -std=c99, where GCC 4.2 would warn that it couldn't
give us C99 inline semantics.

ok guenther@, dcoppa@, millert@, deraadt@
2010-07-25 15:35:29 +00:00
espie
ddaabf24dd allow extern inline stuff to proceed unchanged thru the mess that the
combined GCC and ISO committees managed to make out of it.

With this, gcc >= 4.3 can grok its way through it correctly.

okay kettenis@, with some help figuring stuff out.
2007-03-17 21:38:14 +00:00
millert
52a0e6034e First step in include files overhaul. Use __FOO_VISIBLE (as defined
in sys/cdefs.h) instead of _FOO_SOURCE.  Also fix several namespace
pollution issues, including the byte order defines.  OK deraadt@
2005-12-13 00:35:22 +00:00
espie
89b0597ffb activate LC_CTYPE for 8 bits locale.
Make sure tolower/toupper use the whole 8 bits.

okay deraadt@
thanks to everyone who tested
2005-08-08 05:52:59 +00:00
avsm
edfd6a1121 fix non-gnu ansi compilers by not using 'inline' but '__inline' instead.
lets tendra build again.
ok deraadt@, pvalchev@, millert@
2004-04-02 22:37:12 +00:00
millert
0e313c936a If lint is defined, act like _ANSI_LIBRARY was defined. That way
lint gets the prototypes it expects and doesn't get confused by the
inline functions.  OK deraadt@
2004-01-15 20:01:27 +00:00
millert
98a299b219 Allow this to compile on non-gcc. OK deraadt@ art@ 2004-01-13 15:47:24 +00:00
millert
b0f0d7e458 Remove an extraneous "& 0xff" (the cast to unsigned char is sufficient).
Use "extern __inline" instead of "static __inline" since the extern
flavor behaves more like a macro (which is what we want).

OK deraadt@ and tested on all platforms by various folks.
2003-06-10 22:00:31 +00:00
millert
e33d3bd3b8 Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.
2003-06-02 19:34:12 +00:00
millert
da2317ca16 Back out __EOF stuff and just use -1 in ctype.h. This is OK since
we don't want any user defines to change how the inlined ctype
functions behave.
2002-12-30 21:36:05 +00:00
millert
5d8e0bc20f Don't define EOF In ctype.h, some 3rd party code checks whether or
not EOF is defined to determine if stdio.h has been included.
Instead, use __EOF which should be OK wrt namespace safety.
2002-12-29 03:02:34 +00:00
millert
0e83f63951 Casting to unsigned int in isfoo() causes problems on alpha and
sparc64.  Change cast back to unsigned char but do a bitwise AND
with 0xff to avoid any sign extension weirdness and to make it
impossible for us to overflow _C_ctype_.  The bitwise AND is probably
not needed and may be removed later if this does not trigger compiler bugs.
2002-12-15 13:53:39 +00:00
millert
40eb0a90c5 fix typo; noticed by David Krause 2002-12-14 14:26:19 +00:00
millert
d5bf51268a Instead of doing "if (c == EOF) return 0;" use the hook ('?') operator
instead to make these one-liners.  Works around a compiler bug on vax
that affects both the libc and inline versions identically.
2002-12-14 02:34:38 +00:00
millert
33f9814b7e Less stupid check for 7-bit ascii in toupper/tolower
Remove useless check for EOF in isascii
2002-12-13 23:16:38 +00:00
millert
32fd4a45c6 Cast to unsigned int, not unsigned char, since what is being cast is an
int, not a char.
2002-12-13 22:39:27 +00:00
millert
81732baed9 Convert ctype.h macros into inline functions. This fixes the issues we
currently have with the macro versions and makes the ctype.h versions
100% identical to what is in libc.
Discussed with pjanzen@ and OK'd by deraadt@.
2002-12-11 23:01:40 +00:00
millert
c72b5b24e1 Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically. 2002-02-16 21:27:05 +00:00
deraadt
5e524d7558 make ctype macros on char 0x82 and such work 1998-04-30 05:49:21 +00:00
niklas
5ea2d675e0 Well, as we are heading for a release people are encouraged to rebuild their
entire trees for testing anyway, I might as well do this intrusive touching
of include files now.  Added openBSD tags.
1997-09-21 10:45:23 +00:00
deraadt
df930be708 initial import of NetBSD tree 1995-10-18 08:37:01 +00:00