Ticket #2203: headers-ansi-2008-05-10.diff

File headers-ansi-2008-05-10.diff, 19.6 KB (added by andreasf, 16 years ago)

patch

  • headers/posix/limits.h

     
    11#ifndef _LIBC_LIMITS_H_
    22#define _LIBC_LIMITS_H_
    3     // Note: The header guard is checked in gcc's limits.h.
     3    /* Note: The header guard is checked in gcc's limits.h. */
    44
    55#include <float.h>      /* for DBL_DIG, FLT_DIG, etc */
    66
  • headers/posix/stdint.h

     
    131131
    132132#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
    133133
    134 // Macros of Integer Constant Expressions
     134/* Macros of Integer Constant Expressions */
    135135#define INT8_C(value)   value
    136136#define INT16_C(value)  value
    137137#define INT32_C(value)  value
     
    142142#define UINT32_C(value) value ## U
    143143#define UINT64_C(value) value ## ULL
    144144
    145 // Macros for greatest-width integer constant expressions
     145/* Macros for greatest-width integer constant expressions */
    146146#define INTMAX_C(value)     value ## LL
    147147#define UINTMAX_C(value)    value ## ULL
    148148
  • headers/posix/string.h

     
    3737extern char     *strstr(const char *string, const char *searchString);
    3838
    3939extern char     *strchrnul(const char *string, int character);
    40     // this is a GNU extension
     40    /* this is a GNU extension */
    4141
    4242extern char     *strpbrk(const char *string, const char *set);
    4343extern char     *strtok(char *string, const char *set);
     
    6666
    6767extern size_t   strnlen(const char *string, size_t count);
    6868
    69 //extern char       *strlwr(char *string);
    70 //extern char       *strupr(char *string);
     69/* extern char      *strlwr(char *string); */
     70/* extern char      *strupr(char *string); */
    7171
    72 //extern char       *strsep(char **stringPointer, const char *delimiter);
     72/* extern char      *strsep(char **stringPointer, const char *delimiter); */
    7373
    7474extern const char   *strsignal(int signal);
    7575
  • headers/posix/fcntl.h

     
    5353#define O_RSYNC         0x00020000  /* read synchronized I/O file integrity */
    5454#define O_DSYNC         0x00040000  /* write synchronized I/O data integrity */
    5555
    56 // TODO: currently not implemented additions:
     56/* TODO: currently not implemented additions: */
    5757#define O_NOFOLLOW      0x00080000
    5858    /* should we implement this? it's similar to O_NOTRAVERSE but will fail on symlinks */
    5959#define O_NOCACHE       0x00100000  /* doesn't use the file system cache if possible */
  • headers/posix/netinet/ip_var.h

     
    138138        int32_t  ips_outhwcsum;          /* hardware checksummed on output */
    139139};
    140140
    141 //#ifdef _KERNEL_MODE
     141/* #ifdef _KERNEL_MODE */
    142142
    143143#define IP_FORWARDING           0x1             /* most of ip header exists */
    144144#define IP_ALLOWBROADCAST       SO_BROADCAST    /* can send broadcast packets */
     
    147147#define IP_MTUDISC              0x10            /* pmtu discovery, set DF */
    148148
    149149#if 0
    150 //struct ipstat ipstat;
     150/* struct ipstat ipstat; */
    151151
    152152void  ipv4_input(struct mbuf *, int);
    153153int   ipv4_output(struct mbuf *, struct mbuf *, struct route *, int, void *);
  • headers/posix/netinet/in.h

     
    2222 * and we are not allowed to import all the BeOS types here.
    2323 */
    2424#ifndef htonl
    25 //  extern uint32_t __swap_int32(uint32_t); /* private */
     25/*  extern uint32_t __swap_int32(uint32_t); */  /* private */
    2626    extern unsigned long __swap_int32(unsigned long);   /* private */
    2727    extern uint16_t __swap_int16(uint16_t); /* private */
    2828    #if     BYTE_ORDER == LITTLE_ENDIAN
  • headers/posix/stdio.h

     
    1010#include <stdarg.h>
    1111
    1212
    13 // Dodge gcc 2.95.3's fixincludes hack stdio_va_list by including this string:
    14 // __gnuc_va_list
     13/* Dodge gcc 2.95.3's fixincludes hack stdio_va_list by including this string:
     14 * __gnuc_va_list */
    1515
    1616
    1717#define BUFSIZ          1024
  • headers/posix/pthread.h

     
    7272#define PTHREAD_PRIO_INHERIT        1
    7373#define PTHREAD_PRIO_PROTECT        2
    7474
    75 //extern pthread_mutexattr_t pthread_mutexattr_default;
     75/* extern pthread_mutexattr_t pthread_mutexattr_default; */
    7676
    7777/* private structure */
    7878struct __pthread_cleanup_handler {
     
    176176
    177177#if 0   /* Unimplemented attribute functions: */
    178178
    179 // mandatory!
     179/* mandatory! */
    180180extern int pthread_attr_getschedparam(const pthread_attr_t *attr,
    181181    struct sched_param *param);
    182182extern int pthread_attr_setschedparam(pthread_attr_t *attr,
    183183    const struct sched_param *param);
    184184
    185 // [TPS]
     185/* [TPS] */
    186186extern int pthread_attr_getinheritsched(const pthread_attr_t *attr,
    187187    int *inheritsched);
    188188extern int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched);
     
    194194    int *contentionscope);
    195195extern int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope);
    196196
    197 // [XSI]
     197/* [XSI] */
    198198extern int pthread_attr_getguardsize(const pthread_attr_t *attr,
    199199    size_t *guardsize);
    200200extern int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize);
    201201
    202 // [TSA]
     202/* [TSA] */
    203203extern int pthread_attr_getstackaddr(const pthread_attr_t *attr,
    204204    void **stackaddr);
    205205extern int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr);
    206206
    207 // [TSA TSS]
     207/* [TSA TSS] */
    208208extern int pthread_attr_getstack(const pthread_attr_t *attr,
    209209    void **stackaddr, size_t *stacksize);
    210210extern int pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr, size_t stacksize);
  • headers/posix/wchar_t.h

     
    33 * Distributed under the terms of the MIT License.
    44 */
    55
    6 // Include GCC's stddef.h. It defines wchar_t.
     6/* Include GCC's stddef.h. It defines wchar_t. */
    77#include <stddef.h>
  • headers/posix/math.h

     
    3434#define __huge_valf_t   union { unsigned char __c[4]; long __l; float __f; }
    3535#define HUGE_VALF       (((__huge_valf_t) { __l: __HUGE_VALF_v }).__f)
    3636
    37 // ToDo: define HUGE_VALL for long doubles
     37/* ToDo: define HUGE_VALL for long doubles */
    3838
    3939#define __NAN_VALF_v    0x7fc00000L
    4040#define NAN             (((__huge_valf_t) { __l: __NAN_VALF_v }).__f)
     
    146146extern long double  roundl(long double x);
    147147extern long     lroundl(long double x);
    148148
    149 // TODO: add and fix those!
     149/* TODO: add and fix those! */
    150150extern /*long*/ double  lgamma(/*long*/ double x);
    151151
    152152/* some BSD non-ANSI or POSIX math functions */
  • headers/posix/size_t.h

     
    77
    88#include <stddef.h>
    99
    10 // TODO: ATM gcc's stddef.h defines ssize_t for BeOS.h. We should fix this.
    11 //typedef long signed int       ssize_t;
     10/* TODO: ATM gcc's stddef.h defines ssize_t for BeOS.h. We should fix this.
     11 * typedef long signed int      ssize_t; */
    1212
    1313#endif /* _SIZE_T_H_ */
  • headers/posix/libio.h

     
    138138    struct _IO_FILE *_chain;
    139139
    140140    int     _fileno;
    141 //  int     _blksize;
     141/*  int     _blksize; */
    142142    int     _flags2;
    143143    off_t   _old_offset; /* This used to be _offset but it's too small. */
    144144        /* -> not true on BeOS, but who cares */
     
    151151    _IO_lock_t *_lock;
    152152
    153153    off_t   _offset;
    154 //#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
     154/* #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T */
    155155    /* Wide character stream stuff.  */
    156156    struct _IO_codecvt *_codecvt;
    157157    struct _IO_wide_data *_wide_data;
    158 //#else
    159 //  void    *__pad1;
    160 //  void    *__pad2;
    161 //#endif
     158/* #else
     159 *  void    *__pad1;
     160 *  void    *__pad2;
     161 * #endif */
    162162    int _mode;
    163163    /* Make sure we don't get into trouble again.  */
    164164    char _unused2[15 * sizeof (int) - 2 * sizeof (void *)];
  • headers/posix/net/route.h

     
    2020#define RTF_BLACKHOLE   0x00001000
    2121#define RTF_LOCAL       0x00200000
    2222
    23 // This structure is used to pass routes to and from the network stack
    24 // (via struct ifreq)
     23/* This structure is used to pass routes to and from the network stack
     24 * (via struct ifreq) */
    2525
    2626struct route_entry {
    2727    struct sockaddr *destination;
  • headers/posix/assert.h

     
    77#undef assert
    88
    99#ifndef NDEBUG
    10     // defining NDEBUG disables assert() functionality
     10    /* defining NDEBUG disables assert() functionality */
    1111
    1212#ifdef __cplusplus
    1313extern "C" {
     
    2626#define assert(assertion) \
    2727    ((assertion) ? (void)0 : __assert_fail(#assertion, __FILE__, __LINE__, __PRETTY_FUNCTION__))
    2828
    29 #else   // NDEBUG
    30 #   define assert(condition) ;
     29#else   /* NDEBUG */
     30#   define assert(condition) ((void)0)
    3131#endif
    3232
    3333#endif  /* _ASSERT_H_ */
  • headers/posix/setjmp.h

     
    77
    88#include <signal.h>
    99
    10 // include architecture specific definitions
     10/* include architecture specific definitions */
    1111#ifdef __INTEL__
    1212    #include <arch/x86/arch_setjmp.h>
    1313#elif __POWERPC__
  • headers/posix/wchar.h

     
    1010#include <stddef.h>
    1111#include <stdio.h>
    1212
    13 // stddef.h is not supposed to define wint_t, but gcc 2.95.3's one does.
    14 // In all other cases we will do that.
     13/* stddef.h is not supposed to define wint_t, but gcc 2.95.3's one does.
     14 * In all other cases we will do that. */
    1515#ifndef _WINT_T
    1616#define _WINT_T
    1717
     
    2121
    2222typedef __WINT_TYPE__ wint_t;
    2323
    24 #endif  // _WINT_T
     24#endif  /* _WINT_T */
    2525
    2626typedef int wctype_t;
    2727
  • headers/posix/unistd.h

     
    208208extern char *optarg;
    209209extern int optind, opterr, optopt;
    210210
    211 // ToDo: should be moved to stdlib.h
     211/* ToDo: should be moved to stdlib.h */
    212212extern char **environ;
    213213
    214214#ifdef __cplusplus
  • headers/posix/signal.h

     
    2525#define SIG_ERR     ((sighandler_t)-1)  /* an error occurred during signal processing */
    2626#define SIG_HOLD    ((sighandler_t)3)   /* the signal was hold */
    2727
    28 // TODO: Support this structure, or more precisely the SA_SIGINFO flag. To do
    29 // this properly we need real-time signal support. Both are commented out for
    30 // the time being to not make "configure" scripts think we do support them.
     28/* TODO: Support this structure, or more precisely the SA_SIGINFO flag. To do
     29 * this properly we need real-time signal support. Both are commented out for
     30 * the time being to not make "configure" scripts think we do support them. */
    3131#if 0
    3232typedef struct {
    3333    int     si_signo;   /* signal number */
     
    6161#define SA_NODEFER      0x08
    6262#define SA_RESTART      0x10
    6363#define SA_ONSTACK      0x20
    64 //#define SA_SIGINFO        0x40
     64/* #define SA_SIGINFO       0x40 */
    6565#define SA_NOMASK       SA_NODEFER
    6666#define SA_STACK        SA_ONSTACK
    6767#define SA_ONESHOT      SA_RESETHAND
     
    248248
    249249typedef struct vregs vregs;
    250250
    251 // include architecture specific definitions
     251/* include architecture specific definitions */
    252252#ifdef __INTEL__
    253253        #include <arch/x86/signal.h>
    254254#elif __POWERPC__
  • headers/posix/inttypes.h

     
    204204
    205205extern intmax_t     strtoimax(const char *string, char **_end, int base);
    206206extern uintmax_t    strtoumax(const char *string, char **_end, int base);
    207 //extern intmax_t       wcstoimax(const __wchar_t *, __wchar_t **, int);
    208 //extern uintmax_t  wcstoumax(const __wchar_t *, __wchar_t **, int);
     207/* extern intmax_t      wcstoimax(const __wchar_t *, __wchar_t **, int); */
     208/* extern uintmax_t wcstoumax(const __wchar_t *, __wchar_t **, int); */
    209209
    210210#ifdef __cplusplus
    211211}
  • headers/posix/ctype.h

     
    7474}
    7575#endif
    7676
    77 #endif // _CTYPE_H
     77#endif /* _CTYPE_H */
  • headers/posix/shadow.h

     
    4949#endif
    5050
    5151
    52 #endif  // _SHADOW_H_
     52#endif  /* _SHADOW_H_ */
  • headers/posix/stdio_post.h

     
    44#ifndef _STDIO_POST_H_
    55#define _STDIO_POST_H_
    66
    7 // "Private"/inline functions of our BeOS compatible stdio implementation
     7/* "Private"/inline functions of our BeOS compatible stdio implementation */
    88
    9 // ToDo: this is a work in progress to make our stdio
    10 //      BeOS' GNU/libio (almost) binary compatible
    11 //      We may not yet be compatible!
     9/* ToDo: this is a work in progress to make our stdio
     10 *      BeOS' GNU/libio (almost) binary compatible
     11 *      We may not yet be compatible! */
    1212
    1313#ifndef _STDIO_H_
    1414#   error "This file must be included from stdio.h!"
     
    1919#endif
    2020
    2121extern char _single_threaded;
    22     // this boolean value is true (1) if there is only the main thread
    23     // running - as soon as you spawn the first thread, it's set to
    24     // false (0)
     22    /* this boolean value is true (1) if there is only the main thread
     23     * running - as soon as you spawn the first thread, it's set to
     24     * false (0) */
    2525
    2626#ifdef __cplusplus
    2727}
  • headers/posix/sys/wait.h

     
    2727#define WIFCORED(value)     ((value) & 0x10000)
    2828#define WIFCONTINUED(value) ((value) & 0x20000)
    2929
    30 // TODO: waitid() is part of the real-time signal extension. Uncomment when
    31 // implemented!
     30/* TODO: waitid() is part of the real-time signal extension. Uncomment when
     31 * implemented! */
    3232#if 0
    3333/* ID types for waitid() */
    3434typedef enum {
     
    3636    P_PID,      /* wait for the child whose process ID matches */
    3737    P_PGID      /* wait for any child whose process group ID matches */
    3838} idtype_t;
    39 #endif  // 0
     39#endif  /* 0 */
    4040
    4141
    4242#ifdef __cplusplus
     
    4545
    4646extern pid_t wait(int *_status);
    4747extern pid_t waitpid(pid_t pid, int *_status, int options);
    48 //extern int waitid(idtype_t idType, id_t id, siginfo_t *info, int options);
     48/* extern int waitid(idtype_t idType, id_t id, siginfo_t *info, int options); */
    4949
    5050#ifdef __cplusplus
    5151}
  • headers/posix/sys/poll.h

     
    77
    88
    99#include <poll.h>
    10     // for compatibility with legacy applications
     10    /* for compatibility with legacy applications */
    1111
    1212
    1313#endif  /* _SYS_POLL_H */
  • headers/posix/sys/stat.h

     
    2424    time_t          st_ctime;       /* last change time, not creation time */
    2525    time_t          st_crtime;      /* creation time */
    2626
    27     // Haiku extensions:
    28     // TODO: we might also define special types for files and TTYs
    29     // TODO: we should find another solution for this, as BStatable::GetStat()
    30     //      can only retrieve the R5 stat structure
     27    /* Haiku extensions:
     28     * TODO: we might also define special types for files and TTYs
     29     * TODO: we should find another solution for this, as BStatable::GetStat()
     30     *      can only retrieve the R5 stat structure */
    3131    unsigned int    st_type;        /* attribute/index type */
    3232};
    3333
     
    110110extern int    mkfifo(const char *path, mode_t mode);
    111111extern mode_t umask(mode_t cmask);
    112112
    113 // This achieves backwards compatibility with R5
    114 #if 0 //def HAIKU_TARGET_PLATFORM_HAIKU
     113/* This achieves backwards compatibility with R5 */
     114#if 0 /* def HAIKU_TARGET_PLATFORM_HAIKU */
    115115#define stat(fd, st) _stat(fd, st, sizeof(struct stat))
    116116#define fstat(fd, st) _fstat(fd, st, sizeof(struct stat))
    117117#define lstat(fd, st) _lstat(fd, st, sizeof(struct stat))
    118118#else
    119 // ... and this fixes the build for R5 for now
     119/* ... and this fixes the build for R5 for now */
    120120extern int    stat(const char *path, struct stat *st);
    121121extern int    fstat(int fd, struct stat *st);
    122122extern int    lstat(const char *path, struct stat *st);
  • headers/posix/sys/resource.h

     
    1717    rlim_t  rlim_max;       /* hard limit */
    1818};
    1919
    20 // ToDo: the only supported mode is RLIMIT_NOFILE right now
     20/* ToDo: the only supported mode is RLIMIT_NOFILE right now */
    2121#define RLIMIT_CORE     0   /* size of the core file */
    2222#define RLIMIT_CPU      1   /* CPU time per team */
    2323#define RLIMIT_DATA     2   /* data segment size */
     
    6262extern int getrlimit(int resource, struct rlimit * rlp);
    6363extern int setrlimit(int resource, const struct rlimit * rlp);
    6464
    65 // ToDo: The following POSIX calls are missing (in BeOS as well):
    66 //int getpriority(int which, id_t who);
    67 //int setpriority(int which, id_t who, int priority);
     65/* ToDo: The following POSIX calls are missing (in BeOS as well):
     66 * int getpriority(int which, id_t who);
     67 * int setpriority(int which, id_t who, int priority); */
    6868
    6969#ifdef __cplusplus
    7070}
  • headers/posix/sys/mman.h

     
    99#include <sys/types.h>
    1010
    1111
    12 // memory protection for mmap() and others
     12/* memory protection for mmap() and others */
    1313#define PROT_READ       0x01
    1414#define PROT_WRITE      0x02
    1515#define PROT_EXEC       0x04
    1616#define PROT_NONE       0x00
    1717
    18 // mmap() flags
     18/* mmap() flags */
    1919#define MAP_SHARED      0x01            /* changes are seen by others */
    2020#define MAP_PRIVATE     0x02            /* changes are only seen by caller */
    2121#define MAP_FIXED       0x04            /* require mapping to specified addr */
    2222#define MAP_ANONYMOUS   0x08            /* no underlying object */
    2323#define MAP_ANON        MAP_ANONYMOUS
    2424
    25 // mmap() error return code
     25/* mmap() error return code */
    2626#define MAP_FAILED      ((void*)-1)
    2727
    2828
     
    3838__END_DECLS
    3939
    4040
    41 #endif  // _SYS_MMAN_H
     41#endif  /* _SYS_MMAN_H */