History log of /freebsd-9.3-release/sys/sys/cdefs.h
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 254606 21-Aug-2013 tijl

MFC r241077:

- Simplify the implementation of atomic_compare_exchange_strong_explicit.
- Evaluate the memory order argument in atomic_fetch_*_explicit macros.
- Implement atomic_store_explicit using atomic_exchange_explicit instead
of a plain assignment.

MFC r241190:

Define clang feature test macro __has_extension. It's used in stdatomic.h.

MFC r254497:

Change the return type of the fallback implementation of the
atomic_compare_exchange_* macros in stdatomic.h to _Bool.


# 254169 09-Aug-2013 marius

MFC: r241374

Add an unified macro to deny ability from the compiler to reorder
instruction loads/stores at its will.
The macro __compiler_membar() is currently supported for both gcc and
clang, but kernel compilation will fail otherwise.

Reviewed by: bde, kib
Discussed with: dim, theraven


# 242893 11-Nov-2012 ed

MFC r240422, r240426 and r240450:

Implement LIST_PREV().

Regular LISTs have been implemented in such a way that the prev-pointer
does not point to the previous element, but to the next-pointer stored
in the previous element. This is done to simplify LIST_REMOVE(). This
macro can be implemented without knowing the address of the list head.

Unfortunately this makes it harder to implement LIST_PREV(), which is
why this macro was never here. Still, it is possible to implement this
macro. If the prev-pointer points to the list head, we return NULL.
Otherwise we simply subtract the offset of the prev-pointer within the
structure.

It's not as efficient as traversing forward of course, but in practice
it shouldn't be that bad. In almost all use cases, people will want to
compare the value returned by LIST_PREV() against NULL, so an optimizing
compiler will not emit code that does more branching than TAILQs.

While there, add __containerof(). Compared to __member2struct(), this
macro has the following advantages:

- It ensures that the type of the pointer is compatible with the member
field of the structure (or a void pointer).
- It works properly in combination with volatile and const, though
unfortunately it drops these qualifiers from the returned value.

mdf@ proposed to add the container_of() macro, just like Linux has.
Eventually I decided against this, as <sys/param.h> is included all over
the place. It seems container_of() on Linux is specific to the kernel,
not userspace. I'd rather not pollute userspace with this.

I also thought about adding __container_of(), but this would have two
advantages. Xorg seems to already have a __container_of(), which is not
compatible with this version. Also, the underscore in the middle
conflicts with our existing macros (__offsetof, __rangeof, etc).


# 237665 27-Jun-2012 jkim

MFC: r237025

Add a convenience macro for the fastcall attribute.


# 235806 22-May-2012 dim

MFC r227478:

Fix kernel build breakage after r227475. I had forgotten kernels are
built with -Wundef, as opposed to world.

Additionally, cdefs.h tends to not use indentation for preprocessor
directives, so remove that too.

Pointy hat to: me


# 235786 22-May-2012 theraven

Merge quick_exit and changes required for C++11 code to compile against FreeBSD headers.

Merges changes from: r227472 r227475 r227475 r227476 r227476 r227490 r227490 r228322 r228323 r228329 r228330 r228528 r228529 r228529 r228901 r228918 r228918 r232971 r232971

Also bump __FreeBSD_version for this and the xlocale merge.


# 235785 22-May-2012 theraven

MFC the xlocale implementation.

Merged revisions: 227487,227753,227807,227818,227999,228002,228875,230156,231673,232498,232601,232620,232626,232926-232927,232929,232931,232935,233173,233600,234573,234578,235239

This currently defines __NO_TLS on ARM (unlike head), because the required
support function has not been MFC'd.


# 235539 17-May-2012 dim

MFC r234785:

Add a convenience macro for the returns_twice attribute, and apply it to
the prototypes of the appropriate functions (getcontext, savectx,
setjmp, sigsetjmp and vfork).


# 233108 18-Mar-2012 ed

MFC r228322,228330,228477,228495,228562,228564,228859,228897,229574,230277:

Bring <sys/cdefs.h> in sync with FreeBSD HEAD:

- Add an __alignof() for non-GCC and GCC < 2.95.
- Attempt to implement the following C11 keywords: _Alignas(),
_Alignof(), _Noreturn, _Static_assert() and _Thread_local.
- Add __generic(), which allows us to do _Generic() in a portable
fashion.
- Improve __offsetof(), __DECONST(), __DEVOLATILE() and __DEQUALIFY()
to use __uintptr_t and __size_t to make them work with less
header prerequisites.
- Add __has_feature(), __has_include() and __has_builtin() to make it
easier to test against Clang features.

Tested by: linimon@'s exp-run (thanks!)


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 218824 18-Feb-2011 nwhitehorn

Turn off default generation of userland dot symbols on powerpc64 now that
we have a binutils that supports it. Kernel dot symbols remain on to assist
DDB.


# 217146 08-Jan-2011 tijl

On 32 bit architectures define (u)int64_t as (unsigned) long long instead
of (unsigned) int __attribute__((__mode__(__DI__))). This aligns better
with macros such as (U)INT64_C, (U)INT64_MAX, etc. which assume (u)int64_t
has type (unsigned) long long.

The mode attribute was used because long long wasn't standardised until
C99. Nowadays compilers should support long long and use of the mode
attribute is discouraged according to GCC Internals documentation.

The type definition has to be marked with __extension__ to support
compilation with "-std=c89 -pedantic".

Discussed with: bde
Approved by: kib (mentor)


# 215701 22-Nov-2010 dim

After some off-list discussion, revert a number of changes to the
DPCPU_DEFINE and VNET_DEFINE macros, as these cause problems for various
people working on the affected files. A better long-term solution is
still being considered. This reversal may give some modules empty
set_pcpu or set_vnet sections, but these are harmless.

Changes reverted:

------------------------------------------------------------------------
r215318 | dim | 2010-11-14 21:40:55 +0100 (Sun, 14 Nov 2010) | 4 lines

Instead of unconditionally emitting .globl's for the __start_set_xxx and
__stop_set_xxx symbols, only emit them when the set_vnet or set_pcpu
sections are actually defined.

------------------------------------------------------------------------
r215317 | dim | 2010-11-14 21:38:11 +0100 (Sun, 14 Nov 2010) | 3 lines

Apply the STATIC_VNET_DEFINE and STATIC_DPCPU_DEFINE macros throughout
the tree.

------------------------------------------------------------------------
r215316 | dim | 2010-11-14 21:23:02 +0100 (Sun, 14 Nov 2010) | 2 lines

Add macros to define static instances of VNET_DEFINE and DPCPU_DEFINE.


# 215318 14-Nov-2010 dim

Instead of unconditionally emitting .globl's for the __start_set_xxx and
__stop_set_xxx symbols, only emit them when the set_vnet or set_pcpu
sections are actually defined.


# 215137 11-Nov-2010 dim

Revert r103230, which depended on ld preserving the __start_xxx and
__stop_xxx symbols for custom sections, even when these were not
referenced (at link time). This behaviour was changed again in binutils
commit 0b8ed435c3fe8bd09a08c23920e65bfb03251221.

This time, put the __GLOBL macro definition in cdefs.h, so it can be
reused in a few other places where it will be needed.

Reviewed by: kib


# 211868 27-Aug-2010 kib

Use private namespace for visibility keyword.

Noted by: bde
MFC after: 3 days


# 211741 24-Aug-2010 kib

Use preferred spelling for the __attribute__.

MFC after: 3 days


# 211335 15-Aug-2010 kib

Add convenience defines for hidden and default/exported attributes.

MFC after: 2 weeks


# 210226 18-Jul-2010 trasz

Revert r210225 - turns out I was wrong; the "/*-" is not license-only
thing; it's also used to indicate that the comment should not be automatically
rewrapped.

Explained by: cperciva@


# 210225 18-Jul-2010 trasz

The "/*-" comment marker is supposed to denote copyrights. Remove non-copyright
occurences from sys/sys/ and sys/kern/.


# 209876 10-Jul-2010 nwhitehorn

The 64-bit PowerPC ABI implemented in binutils 2.15 requires some special
quirks for weak-symbol handling. Text symbols require also marking weak
the special dot-symbol associated with the function, and data symbols
require that you not do that. To fix this, provide a hacked
__weak_reference for powerpc64, and define a new __weak_reference_data
for the single weak data symbol in base.

Revert after: binutils 2.17 import
Obtained from: projects/ppc64


# 202628 19-Jan-2010 ed

Recommit r193732:

Remove __gnu89_inline.

Now that we use C99 almost everywhere, just use C99-style in the pmap
code. Since the pmap code is the only consumer of __gnu89_inline, remove
it from cdefs.h as well. Because the flag was only introduced 17 months
ago, I don't expect any problems.

Reviewed by: alc

It was backed out, because it prevented us from building kernels using a
7.x compiler. Now that most people use 8.x, there is nothing that holds
us back. Even if people run 7.x, they should be able to build a kernel
if they run `make kernel-toolchain' or `make buildworld' first.


# 193734 08-Jun-2009 ed

Revert my change; reintroduce __gnu89_inline.

It turns out our compiler in stable/7 can't build this code anymore.
Even though my opinion is that those people should just run `make
kernel-toolchain' before building a kernel, I am willing to wait and
commit this after we've branched stable/8.

Requested by: rwatson


# 193732 08-Jun-2009 ed

Remove __gnu89_inline.

Now that we use C99 almost everywhere, just use C99-style in the pmap
code. Since the pmap code is the only consumer of __gnu89_inline, remove
it from cdefs.h as well. Because the flag was only introduced 17 months
ago, I don't expect any problems.

Reviewed by: alc


# 189247 01-Mar-2009 ed

Hide __restrict from lint, just like we do with other keywords.

Unlike GCC, LLVM defines __STDC_VERSION__ to 199901L by default. This
means `restrict' keywords in files end up being given to lint, which
results in errors during compilation of usr.bin/xlint.

Other keywords are also expanded to nothing when using lint, so do the
same with restrict.


# 189209 01-Mar-2009 das

Fix a typo in the previous commit.

Submitted by: Mel <mel@rachie.is-a-geek.net>


# 189134 28-Feb-2009 das

Add visibility constants for POSIX.1-2008.


# 187961 31-Jan-2009 das

Add a function attribute called `__malloc_like', which informs gcc
that the annotated function returns a pointer that doesn't alias any
extant pointer. This results in a 50%+ speedup in microbenchmarks such
as the following:

char *cp = malloc(1), *buf = malloc(BUF);
for (i = 0; i < BUF; i++) buf[i] = *cp;

In real programs, your mileage will vary. Note that gcc already
performs this optimization automatically for any function called
`malloc', `calloc', `strdup', or `strndup' unless -fno-builtins is
used.


# 184129 21-Oct-2008 rdivacky

Remove __CC_INT_IS_32BIT define which was used to fix mpt driver
but is not used anymore. This define is not referenced by anything
in the FreeBSD srcs nor google shows any usage. Kernel and world
builds fine without it.

Approved by: kib (mentor)


# 177618 25-Mar-2008 sam

add __noinline

Submitted by: imp
Reviewed by: kan (long ago)
MFC after: 3 weeks


# 174496 09-Dec-2007 alc

Eliminate compilation warnings due to the use of non-static inlines
through the introduction and use of the __gnu89_inline attribute.

Submitted by: bde (i386)
MFC after: 3 days


# 162488 20-Sep-2006 kan

Use __builtin_offsetof for GCC 4.1.


# 156607 12-Mar-2006 deischen

Add macros for generating symbol version assembler opcodes.


# 154867 26-Jan-2006 stefanf

Analogous to __printflike and __scanflike, add the macro __format_arg which
expands to the GCC format_arg attribute if supported.

This fixes a syntax error in <nl_types.h> for compilers/tools not
implementing the GCC __attribute__ extensions.


# 150976 05-Oct-2005 netchild

Don't use the builtin vaalist for icc.

Submitted by: Igor Sysoev <is@rambler-co.ru>
MFC after: 3 days


# 148005 14-Jul-2005 kbyanc

Remove superfluous semicolon at the end of the __strong_reference() macro
definition.


# 146941 03-Jun-2005 kan

Use predefined __offsetof__ builtin function when compiling C++ sources.


# 143251 07-Mar-2005 stefanf

The macros __GNUCLIKE_ATTRIBUTE_PRINTF and
__CC_SUPPORTS_FORWARD_REFERENCE_CONSTRUCT are no longer needed, remove them.


# 143063 02-Mar-2005 joerg

netchild's mega-patch to isolate compiler dependencies into a central
place.

This moves the dependency on GCC's and other compiler's features into
the central sys/cdefs.h file, while the individual source files can
then refer to #ifdef __COMPILER_FEATURE_FOO where they by now used to
refer to #if __GNUC__ > 3.1415 && __BARC__ <= 42.

By now, GCC and ICC (the Intel compiler) have been actively tested on
IA32 platforms by netchild. Extension to other compilers is supposed
to be possible, of course.

Submitted by: netchild
Reviewed by: various developers on arch@, some time ago


# 139825 07-Jan-2005 imp

/* -> /*- for license, minor formatting changes


# 133604 12-Aug-2004 julian

Add a macro to define the size of a subsection of a structure.
Used in fork1() and thr_create()


# 132782 28-Jul-2004 kan

Introduce __used attribute which serves as logical conuterpart of
preexisting __unused.


# 132538 22-Jul-2004 tjr

Add a macro, __pure, which expands to __attribute__((__pure__)) on gcc
versions that support it (>=2.96). This is similar to but not the same
as the __pure macro that was removed in rev. 1.21.


# 127976 07-Apr-2004 imp

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core


# 126891 12-Mar-2004 trhodes

These are changes to allow to use the Intel C/C++ compiler (lang/icc)
to build the kernel. It doesn't affect the operation if gcc.

Most of the changes are just adding __INTEL_COMPILER to #ifdef's, as
icc v8 may define __GNUC__ some parts may look strange but are
necessary.

Additional changes:
- in_cksum.[ch]:
* use a generic C version instead of the assembly version in the !gcc
case (ASM code breaks with the optimizations icc does)
-> no bad checksums with an icc compiled kernel
Help from: andre, grehan, das
Stolen from: alpha version via ppc version
The entire checksum code should IMHO be replaced with the DragonFly
version (because it isn't guaranteed future revisions of gcc will
include similar optimizations) as in:
---snip---
Revision Changes Path
1.12 +1 -0 src/sys/conf/files.i386
1.4 +142 -558 src/sys/i386/i386/in_cksum.c
1.5 +33 -69 src/sys/i386/include/in_cksum.h
1.5 +2 -0 src/sys/netinet/igmp.c
1.6 +0 -1 src/sys/netinet/in.h
1.6 +2 -0 src/sys/netinet/ip_icmp.c

1.4 +3 -4 src/contrib/ipfilter/ip_compat.h
1.3 +1 -2 src/sbin/natd/icmp.c
1.4 +0 -1 src/sbin/natd/natd.c
1.48 +1 -0 src/sys/conf/files
1.2 +0 -1 src/sys/conf/files.amd64
1.13 +0 -1 src/sys/conf/files.i386
1.5 +0 -1 src/sys/conf/files.pc98
1.7 +1 -1 src/sys/contrib/ipfilter/netinet/fil.c
1.10 +2 -3 src/sys/contrib/ipfilter/netinet/ip_compat.h
1.10 +1 -1 src/sys/contrib/ipfilter/netinet/ip_fil.c
1.7 +1 -1 src/sys/dev/netif/txp/if_txp.c
1.7 +1 -1 src/sys/net/ip_mroute/ip_mroute.c
1.7 +1 -2 src/sys/net/ipfw/ip_fw2.c
1.6 +1 -2 src/sys/netinet/igmp.c
1.4 +158 -116 src/sys/netinet/in_cksum.c
1.6 +1 -1 src/sys/netinet/ip_gre.c
1.7 +1 -2 src/sys/netinet/ip_icmp.c
1.10 +1 -1 src/sys/netinet/ip_input.c
1.10 +1 -2 src/sys/netinet/ip_output.c
1.13 +1 -2 src/sys/netinet/tcp_input.c
1.9 +1 -2 src/sys/netinet/tcp_output.c
1.10 +1 -1 src/sys/netinet/tcp_subr.c
1.10 +1 -1 src/sys/netinet/tcp_syncache.c
1.9 +1 -2 src/sys/netinet/udp_usrreq.c

1.5 +1 -2 src/sys/netinet6/ipsec.c
1.5 +1 -2 src/sys/netproto/ipsec/ipsec.c
1.5 +1 -1 src/sys/netproto/ipsec/ipsec_input.c
1.4 +1 -2 src/sys/netproto/ipsec/ipsec_output.c

and finally remove
sys/i386/i386 in_cksum.c
sys/i386/include in_cksum.h
---snip---
- endian.h:
* DTRT in C++ mode
- quad.h:
* we don't use gcc v1 anymore, remove support for it
Suggested by: bde (long ago)
- assym.h:
* avoid zero-length arrays (remove dependency on a gcc specific
feature)
This change changes the contents of the object file, but as it's
only used to generate some values for a header, and the generator
knows how to handle this, there's no impact in the gcc case.
Explained by: bde
Submitted by: Marius Strobl <marius@alchemy.franken.de>
- aicasm.c:
* minor change to teach it about the way icc spells "-nostdinc"
Not approved by: gibbs (no reply to my mail)
- bump __FreeBSD_version (lang/icc needs to know about the changes)

Incarnations of this patch survive gcc compiles since a loooong time,
I use it on my desktop. An icc compiled kernel works since Nov. 2003
(exceptions: snd_* if used as modules), it survives a build of the
entire ports collection with icc.

Parts of this commit contains suggestions or submissions from
Marius Strobl <marius@alchemy.franken.de>.

Reviewed by: -arch
Submitted by: netchild


# 121783 31-Oct-2003 peter

While not illegal, attempt to pacify gcc -Wundef. It just so happens
that libtool-using packages seem to love using this flag.

/usr/include/sys/cdefs.h:184:5: warning: "__STDC_VERSION__" is not defined
/usr/include/sys/cdefs.h:372:5: warning: "_POSIX_C_SOURCE" is not defined
/usr/include/sys/cdefs.h:378:5: warning: "_POSIX_C_SOURCE" is not defined


# 120629 01-Oct-2003 mux

Remove extra parentheses from the __GNUC_PREREQ__ macro.

Prodded by: bde


# 120609 30-Sep-2003 mux

Introduce new __predict_false(exp) and __predict_true(exp) keywords.
Their purpose is to give explicit hints to the compiler to judge
the likelyhood of a test to succeed or fail. Not all architectures
have support for such optimizations, but for those who do, it can
give a nice performance improvement in hot loops.

Obviously, this should be used very rarely in very specific code.

Reviewed by: peter
Obtained from: OpenBSD


# 120608 30-Sep-2003 mux

Define a new __GNUC_PREREQ__(maj, min) to test if we have a specific
version of GCC or later and use it where appropriate. It makes this
file more readable.

Obtained from: OpenBSD


# 118023 25-Jul-2003 gad

Discussions on src-committers with alfred and bde pointed out that
the "do-nothing" versions of __RCSID(), __RCSID_SOURCE(), __SCCSID(),
and __COPYRIGHT() were not strictly correct. They should not expand
into [nothing], because the ';' which follows them would then cause
a syntax error (in a strict C compiler, if not gcc...).

So, change the do-nothing versions of those macros to use the
'struct __hack' tactic, as was already used with __FBSDID().

Approved by: discussions with bde
MFC after: 1 week


# 117906 22-Jul-2003 peter

Attempt to preempt any new gcc-ism references to
__attribute__((__always_inline__)) by adding an __always_inline macro
(used like __dead2 etc). __inline_damnit has also been suggested but we
have a precedent of keeping the names similar so they are easier to find.


# 117905 22-Jul-2003 imp

There is strong reason to believe that gcc 4 will also support
__attribute__((__nonnull__(x)), assume it so.


# 117837 21-Jul-2003 phk

Add a new macro __nonnull(x) to use the new GCC33 attribute which checks
that an argument is not a NULL pointer.

Apply various obvious places.

I belive __printf*() implies __nonnull() so it is not needed on functions
already tagged that way.


# 116396 15-Jun-2003 des

Remove the definition of alloca(), it does not belong here.


# 116326 14-Jun-2003 obrien

Use GCC's internal built-in alloca implementation, when available.

Submitted by: DES


# 113679 18-Apr-2003 bde

Backed out rev.1.57. This restores format checking functions like
err() again. All known err() format errors in src that developed
while format checking was broken have been fixed. Tested on i386,
alpha, ia64.


# 105654 21-Oct-2002 mike

Add the ability to specify a strict C99 environment with the
_C99_SOURCE constant, which should be defined before including any
standard headers.


# 104591 07-Oct-2002 mike

Fix a spelling error in a comment.

Submitted by: Craig Rodrigues <rodrigc@attbi.com>


# 103845 23-Sep-2002 peter

Alfred got me thinking. Provide stubs for lint, and let the compilers
themselves cause a failure if it is told to use a __widget that there is
no implementation for them. missing an implementation for __unused etc is
harmless. But not having a __packed implementation when the kernel code
really needs it is a big deal.


# 103841 23-Sep-2002 peter

I cannot win. I still managed to use #define<space> twice instead of
#define<tab> in spite of trying to make sure I didn't do this.


# 103836 23-Sep-2002 peter

Add a __section(x) macro as well. Use this in linker_set.h. ie:
static void const * const __set_##set##_sym_##sym
__attribute__((__section__("set_" #set),__unused__)) = &sym
becomes:
static void const * const __set_##set##_sym_##sym
__section("set_" #set) __unused = &sym
Like the other macros, these #define away for unrecognized compilers or
lint.

Also, fix the argments in the previous commit for the non-gcc case. lint
might be a bit happier about that. Note that the gcc <= 2.6 case
needs some research.


# 103834 23-Sep-2002 peter

At great personal risk, add a __packed and __aligned(x) define that
expand to __attribute__((packed)) and __attribute__((aligned(x)))
respectively. Replace the handful of gcc-ism's that use
__attribute__((aligned(16))) etc around the kernel with __aligned(16).

There are over 400 __attribute__((packed)) to deal with, that can come
later. I just want to use __packed in new code rather than add more
gcc-ism's.


# 103436 16-Sep-2002 peter

Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports. As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL. It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha


# 103370 16-Sep-2002 wollman

Reformat an overly-wide comment.


# 103345 15-Sep-2002 bde

Define __LONG_LONG_SUPPORTED if the compiler claims to support C99.
Don't set __LONG_LONG_SUPPORTED for gcc-1. I didn't check exactly
when gcc started to support long long, but it was in the version
of gcc in FreeBSD-1.0 (gcc-2.4.5).

Other C99 features should be ifdefed similarly, but the ifdefs for
old versions of gcc will be more complicated since the features
weren't in all versions of gcc-2.


# 100109 15-Jul-2002 wollman

Identify the C Language Binding Option of IEEE Std. 1003.2-1992.
This represents the original standardization of the following functions
and headers:

popen()
<regex.h>: regcomp(), regexec(), regerror(), regfree()
<fnmatch.h>: fnmatch()
getopt(), optarg, optind, opterr, optopt
<glob.h>: glob()
<wordexp.h>: wordexp(), wordfree()
confstr()


# 99904 13-Jul-2002 mikeh

Typo.


# 99755 11-Jul-2002 dillon

Disable format checking for NULL-passing prototypes (really only err*(),
warn*(), and setproctitle() functions) to buildworld work again. This
can be cleaned up later if/when a new GCC supports the feature (but personally
I think it's a waste of time to keep mod'ing imported GCC sources for this
since only three procedures are involved).

Suggested by: peter


# 99594 08-Jul-2002 mike

Move __offsetof() macro from <machine/ansi.h> to <sys/cdefs.h>. It's
hardly MD, since all our platforms share the same macro. It's not
really compiler dependent either, but this helps in reducing
<machine/ansi.h> to only type definitions.


# 97258 24-May-2002 alfred

Backout 1.54 (restore definition for printf0 to actually do something).


# 96390 11-May-2002 alfred

As a temporary bandaid disable '__printf0like' unconditionally, it
doesn't seem to work under gcc 3.1 yet.

We are now 'WERROR' safe again.


# 93996 06-Apr-2002 obrien

Make the previous revision work a little bit better.


# 93993 06-Apr-2002 obrien

Add __SCCSID. And add the NO__SCCSID, NO__RCSID, NO__RCSID_SOURCE, and
NO__COPYRIGHT knobs to more easily deal with imported vendor sources.


# 93715 03-Apr-2002 peter

Deal with "#define _XOPEN_SOURCE" in header files (eg: XFree86 4.2.0)
which caused a syntax error here:
#if _XOPEN_SOURCE >= 600
etc. This is a hack, but I have seen things like it around elsewhere.

Tested by: dwcjr


# 93510 01-Apr-2002 mike

Implement a fine-grain control system which allows header developers
to control the exposure of macros and prototypes depending upon the
POSIX, X/Open, or ISO C version an application has requested.

Submitted by: wollman
Reviewed by: bde, imp


# 87320 03-Dec-2001 obrien

Back out rev 1.48. The problem is with a bogus __attribute__ in stdio.h.


# 87264 03-Dec-2001 obrien

Reapply rev 1.37 (hide the __attribute__ gcc keyword) into RELENG_4 even
though it was backed out.
With out this change the TenDRA compiler is not bootstrapable.


# 86803 23-Nov-2001 mike

Add support for the `restrict' type qualifier, new in C99.

Reviewed by: wollman


# 86302 12-Nov-2001 mike

Add the ability to distinguish between compile environments that
support `long long' and those that don't.

Reviewed by: bde


# 85672 29-Oct-2001 mike

Use a more sophisticated check that works better with older versions
of GCC when setting __func__ to NULL. This also better supports GCC
when using C++. Move the definition to a better location.

Submitted by: bde


# 85607 27-Oct-2001 mike

Only provide function information in compile environments that support
the C99 variable __func__ and never for C++. Provide a more meaningful
example in the assert(3) manual.

Reviewed by: asmodai, bde


# 83670 19-Sep-2001 asmodai

Solve our braindead sourcetree dependency on GCC in another way.

Discussed with: bde


# 83552 16-Sep-2001 dillon

Avoid empty decls when __FBSDIDs are turned off.

Suggested by: bde
MFC after: 1 week


# 83528 15-Sep-2001 obrien

Fix the improper backout.


# 83526 15-Sep-2001 obrien

Back out rev 1.38. Even though it saves a little space on the line,
it confuses indent(1).

Requested by: bde


# 83524 15-Sep-2001 obrien

Allow __FBSDID() to be used without ;


# 83489 15-Sep-2001 dillon

Add __FBSDID() macro to support rcs identifiers in source files.


# 83444 14-Sep-2001 asmodai

For old gcc/gcc-based compilers and non gcc compilers make sure to
hide the __attribute__ gcc keyword.

Reviewed and helped by: peter


# 83443 14-Sep-2001 asmodai

style(9) correct #define's followed by a space to be followed by a tab
instead.

MFC after: 2 weeks


# 83056 05-Sep-2001 peter

It is the last-second trivial changes that kill me every time.
Fix nested comment. :-(

Submitted by: obrien


# 83049 05-Sep-2001 peter

Attempt to refine the __IDSTRING() macros so that they dont collide with
each other. This will allow multiple __RCSID() entries in the same file
and even __RCSID() in headers. **HOWEVER**, the usefulness of this in
headers is somewhat marginal in non-ELF since they would go into the
data section where they cannot be easily compressed or stripped.
It (id's in headers) is also not useful in the non-GCC case since it is
hard to generate unique variable names. I have an idea on that though.

Now for mcs: http://mirrors.ccs.neu.edu/cgi-bin/unixhelp/man-cgi?mcs+1


# 77631 02-Jun-2001 obrien

Support GCC 3.0


# 74070 10-Mar-2001 billf

after discovering that the Santa Clara Valley Medical Center actually
has a burn unit and is only 8 miles away...

add __DECONST(), __DEVOLATILE(), and __DEQUALIFY()


# 72753 20-Feb-2001 obrien

Back out a controverial commit.


# 72749 20-Feb-2001 obrien

MFS: rev 1.28.2.2 - Support GCC 3.0.


# 58256 18-Mar-2000 jasone

Use __alias__ instead of alias in the definition of __strong_reference().

Submitted by: jdp


# 56904 30-Jan-2000 jasone

Do not use 'alias' as a macro parameter name for __strong_reference(),
since the word 'alias' appears in the macro body.

Approved by: jkh


# 56887 29-Jan-2000 jasone

Add __strong_reference().


# 50614 30-Aug-1999 peter

If using GNUC and ELF, make __IDSTRING() expand into an inline asm
statement to put the rcsid into the .comment section. This allows
the comments (ie:version id's of compiler, headers, source, etc) to be
stripped out with the standard tools (strip/objcopy). SVR4 has a
tool called 'mcs' (manipulate comment section) which allows you to
add/remove/compact strings. Removing duplicate strings helps a lot
if the headers generate them.
Using __attribute__((section(".comment"))) would probably also work,
but that still leaves the RCSID occupying C name space somewhere.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 40736 29-Oct-1998 jdp

Per request from ache, change the numbering scheme of __FreeBSD_cc_version.
Its form is now like __FreeBSD_version, with the FreeBSD revision in
the top digits.


# 40716 29-Oct-1998 jdp

Make the definition of __printf0like() vary according to the value
of __FreeBSD_cc_version, so that its use is safe with older compilers
and with non-FreeBSD compilers.


# 39502 20-Sep-1998 jdp

Null-terminate the message for a warning symbol in the __warn_references()
macro for ELF. Ian@cygnus.com says that is the proper way to use
the ".gnu.warning.SYMBOL" sections. However, he has accepted Doug
Rabson's BFD patch anyway.


# 38509 24-Aug-1998 bde

Removed support for the gcc-2.[0-4] keywords __dead and __pure. They
stopped being used in /usr/src almost 2 years ago.

Don't pretend to support gcc-[3-infinity].

Added __printf0like(). Feature tests for the __printf0__ feature
are problematic, so this can't be used for the err() family yet
- it's only in recent versions of FreeBSD's hacked version of gcc.

Added comments about __unused and __*like().


# 37862 25-Jul-1998 dfr

Make __weak_reference work on the alpha.


# 37614 13-Jul-1998 bde

Added macros __printflike() and __scanflike() to <sys/cdefs.h>.
Use them to `make gcc -Wformat' check formats for all printf-like
and scanf-like functions in /usr/src except for the err()/warn()
family. err() isn't quite printf-like since its format arg can
legitimately be NULL. syslog() isn't quite printf-like, but gcc
already accepts %m, even for plain printf() when it shouldn't.


# 37052 18-Jun-1998 peter

ELF versions of __warn_references() and __weak_reference(). Note that this
doesn't work with libc/net/res_stubs.c since gas wants the weak reference
to take place in the same context as the real definition, presumably so
that it can get hold of the symbol typing etc.
However, this doesn't matter for libc/elf since we don't have binaries
that use the old symbol names.


# 36971 14-Jun-1998 bde

Don't define away __attribute__() for the non-gcc and old-gcc cases.
Using __attribute__() in non-ifdefed code is just wrong if it changes
the semantics, and there is no way to ignore __attribute__() only in
the benign cases.

Don't use __attribute__ in non-ifdefed code here. It was a benign
case, but we already have a macro (__unused) for this case.

Expanded comment about gotchas for __CONCAT() in the non-ANSI case.


# 36449 28-May-1998 dt

Remove extraneous ";" from C++'s version of __END_DECLS.

Found by: TenDRA C++


# 31707 13-Dec-1997 pst

Bring in NetBSD compatible & augmented RCSID/COPYRIGHT macros


# 25083 22-Apr-1997 jdp

Make the necessary changes so that an ELF kernel can be built. I
have successfully built, booted, and run a number of different ELF
kernel configurations, including GENERIC. LINT also builds and
links cleanly, though I have not tried to boot it.

The impact on developers is virtually nil, except for two things.
All linker sets that might possibly be present in the kernel must be
listed in "sys/i386/i386/setdefs.h". And all C symbols that are
also referenced from assembly language code must be listed in
"sys/i386/include/asnames.h". It so happens that failure to do
these things will have no impact on the a.out kernel. But it will
break the build of the ELF kernel.

The ELF bootloader works, but it is not ready to commit quite yet.


# 22975 22-Feb-1997 peter

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 17648 18-Aug-1996 peter

Add __unused to the list of __dead, __dead2, __pure, __pure2 etc.

gcc-2.7 has __attribute__((unused)) as a postfix operator on function
arguments to prevent -Wunused from complaining about them. gcc < 2.7
doesn't have anything like this (and doesn't care about it either).

eg:
int foo(bar, baz)
int bar __unused; /* needed because of function pointer typing */
char *baz __unused;
{
return (1);
}


# 15243 13-Apr-1996 bde

Changed `noreturn' to `__noreturn__' so that all headers don't break if
an application #defines `noreturn'.

Changed one instance of `const' similarly. This is less like to be a
problem since applications shouldn't #define `const', and the common
hack of #defining `const' as nothing gives harmless (?) null attributes
instead of syntax errors.

Fixed comments on #endifs to match code.


# 14495 11-Mar-1996 hsu

Merge in Lite2: no changes required. Just update CSRG id.
Our changes since Lite1 include all the added functionality of Lite2.
Reviewed by: davidg & bde


# 5209 23-Dec-1994 nate

Warning and weak reference macros which are used to generate link-time
messages.

Obtained from: NetBSD


# 5012 08-Dec-1994 bde

Fix __CONCAT() for the ANSI case to work with #define'd args, in
particular, when one of the args is another __CONCAT().


# 2212 22-Aug-1994 bde

- Fix attribute for __pure2.
- Update name of idempotency identifier in comment to match code.


# 2165 21-Aug-1994 paul

Made them all idempotent.
Reviewed by:
Submitted by:


# 2059 13-Aug-1994 dg

Made the kernel compile cleanly with gcc 2.6.0. Thanks go to Bruce
Evans for suggesting a method to detect various versions of gcc.


# 1817 02-Aug-1994 dg

Added $Id$


# 1549 25-May-1994 rgrimes

The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.

Reviewed by: Rodney W. Grimes
Submitted by: John Dyson and David Greenman


# 1542 24-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1541,
which included commits to RCS files with non-trunk default branches.


# 1541 24-May-1994 rgrimes

BSD 4.4 Lite Kernel Sources