<ansi.h> -> <minix/ansi.h>

This commit is contained in:
Ben Gras
2011-01-28 11:35:02 +00:00
parent e912f6ac38
commit dc1cc91df1
69 changed files with 99 additions and 97 deletions

View File

@@ -109,8 +109,8 @@ struct nlist { /* symbol table entry */
#define C_STAT 0030 /* static */
/* Function prototypes. */
#ifndef _ANSI_H
#include <ansi.h>
#ifndef _MINIX_ANSI_H
#include <minix/ansi.h>
#endif
_PROTOTYPE( int nlist, (char *_file, struct nlist *_nl) );

76
include/minix/ansi.h Normal file
View File

@@ -0,0 +1,76 @@
/* The <minix/ansi.h> header attempts to decide whether the compiler has enough
* conformance to Standard C for Minix to take advantage of. If so, the
* symbol _ANSI is defined (as 31459). Otherwise _ANSI is not defined
* here, but it may be defined by applications that want to bend the rules.
* The magic number in the definition is to inhibit unnecessary bending
* of the rules. (For consistency with the new '#ifdef _ANSI" tests in
* the headers, _ANSI should really be defined as nothing, but that would
* break many library routines that use "#if _ANSI".)
* If _ANSI ends up being defined, a macro
*
* _PROTOTYPE(function, params)
*
* is defined. This macro expands in different ways, generating either
* ANSI Standard C prototypes or old-style K&R (Kernighan & Ritchie)
* prototypes, as needed. Finally, some programs use _CONST, _VOIDSTAR etc
* in such a way that they are portable over both ANSI and K&R compilers.
* The appropriate macros are defined here.
*/
#ifndef _MINIX_ANSI_H
#define _MINIX_ANSI_H
#if __STDC__ == 1
#define _ANSI 31459 /* compiler claims full ANSI conformance */
#endif
#ifdef __GNUC__
#define _ANSI 31459 /* gcc conforms enough even in non-ANSI mode */
#endif
#define _VOIDSTAR void *
#define _VOID void
#ifdef _ANSI
/* Keep everything for ANSI prototypes. */
#define _PROTOTYPE(function, params) function params
#define _ARGS(params) params
#define _CONST const
#define _VOLATILE volatile
#define _SIZET size_t
#else
/* Throw away the parameters for K&R prototypes. */
#define _PROTOTYPE(function, params) function()
#define _ARGS(params) ()
#define _CONST
#define _VOLATILE
#define _SIZET int
#endif /* _ANSI */
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901
#define __LONG_LONG_SUPPORTED 1
#endif
/* This should be defined as restrict when a C99 compiler is used. */
#define _RESTRICT
/* Setting any of _MINIX, _POSIX_C_SOURCE or _POSIX2_SOURCE implies
* _POSIX_SOURCE. (Seems wrong to put this here in ANSI space.)
*/
#if defined(_MINIX) || _POSIX_C_SOURCE > 0 || defined(_POSIX2_SOURCE)
#undef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#endif
/* What is a va_list? */
#include <stdarg.h>
#define _BSD_VA_LIST_ va_list
#endif /* _MINIX_ANSI_H */

View File

@@ -11,7 +11,7 @@
/* The following are so basic, all the *.c files get them automatically. */
#include <minix/config.h> /* MUST be first */
#include <ansi.h> /* MUST be second */
#include <minix/ansi.h> /* MUST be second */
#include <minix/type.h>
#include <minix/ipc.h>
#include <minix/com.h>

View File

@@ -11,7 +11,7 @@
/* The following are so basic, all the *.c files get them automatically. */
#include <minix/config.h> /* MUST be first */
#include <ansi.h> /* MUST be second */
#include <minix/ansi.h> /* MUST be second */
#include <minix/type.h>
#include <minix/com.h>
#include <minix/dmap.h>

View File

@@ -1,8 +1,8 @@
#ifndef _MINLIB
#define _MINLIB
#ifndef _ANSI_H
#include <ansi.h>
#ifndef _MINIX_ANSI_H
#include <minix/ansi.h>
#endif
/* Miscellaneous BSD. */

View File

@@ -2,7 +2,7 @@
#define _MTHREAD_H
#include <minix/config.h> /* MUST be first */
#include <ansi.h> /* MUST be second */
#include <minix/ansi.h> /* MUST be second */
#include <minix/const.h>
#include <sys/types.h>
#include <stdio.h>

View File

@@ -1,7 +1,7 @@
#ifndef _PROFILE_H
#define _PROFILE_H
#include <ansi.h>
#include <minix/ansi.h>
#include <minix/type.h>
/*

View File

@@ -4,7 +4,7 @@
#ifndef _MINIX__QUERYPARAM_H
#define _MINIX__QUERYPARAM_H
#include <ansi.h>
#include <minix/ansi.h>
typedef size_t _mnx_size_t;

View File

@@ -7,8 +7,8 @@
#ifndef _TYPES_H
#define _TYPES_H
#ifndef _ANSI_H
#include <ansi.h>
#ifndef _MINIX_ANSI_H
#include <minix/ansi.h>
#endif
typedef unsigned char u8_t; /* 8 bit type */