--- Net2/sys/cdefs.h 2018/04/24 18:03:58 1.1 +++ Net2/sys/cdefs.h 2018/04/24 18:16:39 1.1.1.2 @@ -30,11 +30,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)cdefs.h 7.6 (Berkeley) 5/4/91 + * from: @(#)cdefs.h 7.6 (Berkeley) 5/4/91 + * cdefs.h,v 1.4 1993/05/26 14:52:56 cgd Exp */ -#ifndef _CDEFS_H_ -#define _CDEFS_H_ +#ifndef _SYS_CDEFS_H_ +#define _SYS_CDEFS_H_ #if defined(__cplusplus) #define __BEGIN_DECLS extern "C" { @@ -75,4 +76,20 @@ #endif /* !__GNUC__ */ #endif /* !(__STDC__ || __cplusplus) */ -#endif /* !_CDEFS_H_ */ +/* + * GCC has extensions for declaring functions as `pure' (always returns + * the same value given the same inputs, i.e., has no external state and + * no side effects) and `dead' (nonreturning). These mainly affect + * optimization and warnings. Unfortunately, GCC complains if these are + * used under strict ANSI mode (`gcc -ansi -pedantic'), hence we need to + * define them only if compiling without this. + */ +#if defined(__GNUC__) && !defined(__STRICT_ANSI__) +#define __dead __volatile +#define __pure __const +#else +#define __dead +#define __pure +#endif + +#endif /* !_SYS_CDEFS_H_ */