mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-10 14:02:43 +00:00
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.
This commit is contained in:
parent
f71e6a5243
commit
ba5fe51088
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99594
@ -38,6 +38,7 @@
|
||||
#ifndef _STDDEF_H_
|
||||
#define _STDDEF_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <machine/ansi.h>
|
||||
|
||||
typedef _BSD_PTRDIFF_T_ ptrdiff_t;
|
||||
|
@ -118,11 +118,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
|
||||
#define _BSD_CLK_TCK_ 100
|
||||
#define _BSD_CLOCKS_PER_SEC_ 100
|
||||
|
||||
/*
|
||||
* We define this here since both <stddef.h> and <sys/types.h> needs it.
|
||||
*/
|
||||
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
|
||||
|
||||
/*
|
||||
* Internal names for basic integral types. Omit the typedef if
|
||||
* not possible for a machine/compiler combination.
|
||||
|
@ -110,11 +110,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
|
||||
#define _BSD_CLK_TCK_ 100
|
||||
#define _BSD_CLOCKS_PER_SEC_ 100
|
||||
|
||||
/*
|
||||
* We define this here since both <stddef.h> and <sys/types.h> needs it.
|
||||
*/
|
||||
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
|
||||
|
||||
/*
|
||||
* XXX this paragraph is very out of date.
|
||||
* Typedefs for especially magic types. #define's wouldn't work in the
|
||||
|
@ -112,11 +112,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
|
||||
#define _BSD_CLK_TCK_ 128
|
||||
#define _BSD_CLOCKS_PER_SEC_ 128
|
||||
|
||||
/*
|
||||
* We define this here since both <stddef.h> and <sys/types.h> needs it.
|
||||
*/
|
||||
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
|
||||
|
||||
/*
|
||||
* XXX this paragraph is very out of date.
|
||||
* Typedefs for especially magic types. #define's wouldn't work in the
|
||||
|
@ -113,11 +113,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
|
||||
#define _BSD_CLK_TCK_ 100
|
||||
#define _BSD_CLOCKS_PER_SEC_ 100
|
||||
|
||||
/*
|
||||
* We define this here since both <stddef.h> and <sys/types.h> needs it.
|
||||
*/
|
||||
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
|
||||
|
||||
/*
|
||||
* Internal names for basic integral types. Omit the typedef if
|
||||
* not possible for a machine/compiler combination.
|
||||
|
@ -119,11 +119,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
|
||||
#define _BSD_CLK_TCK_ 100
|
||||
#define _BSD_CLOCKS_PER_SEC_ 100
|
||||
|
||||
/*
|
||||
* We define this here since both <stddef.h> and <sys/types.h> needs it.
|
||||
*/
|
||||
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
|
||||
|
||||
/*
|
||||
* Internal names for basic integral types. Omit the typedef if
|
||||
* not possible for a machine/compiler combination.
|
||||
|
@ -113,11 +113,6 @@ typedef _BSD_VA_LIST_ __gnuc_va_list; /* compatibility w/GNU headers*/
|
||||
#define _BSD_CLK_TCK_ 100
|
||||
#define _BSD_CLOCKS_PER_SEC_ 100
|
||||
|
||||
/*
|
||||
* We define this here since both <stddef.h> and <sys/types.h> needs it.
|
||||
*/
|
||||
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
|
||||
|
||||
/*
|
||||
* Internal names for basic integral types. Omit the typedef if
|
||||
* not possible for a machine/compiler combination.
|
||||
|
@ -152,6 +152,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
|
||||
* require it.
|
||||
*/
|
||||
#define __offsetof(type, field) ((size_t)(&((type *)0)->field))
|
||||
|
||||
/*
|
||||
* Compiler-dependent macros to declare that functions take printf-like
|
||||
* or scanf-like arguments. They are null except for versions of gcc
|
||||
|
@ -37,7 +37,7 @@
|
||||
#ifndef _SYS_QUEUE_H_
|
||||
#define _SYS_QUEUE_H_
|
||||
|
||||
#include <machine/ansi.h> /* for __offsetof */
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
/*
|
||||
* This file defines four types of data structures: singly-linked lists,
|
||||
|
Loading…
Reference in New Issue
Block a user