Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/head/iso/stdio_iso.h
          +++ new/usr/src/head/iso/stdio_iso.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   *
  14   14   * When distributing Covered Code, include this CDDL HEADER in each
  15   15   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16   16   * If applicable, add the following below this CDDL HEADER, with the
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
       23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
       24 + *
  23   25   * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24   26   * Use is subject to license terms.
  25   27   */
  26   28  
  27   29  /*      Copyright (c) 1988 AT&T */
  28   30  /*        All Rights Reserved   */
  29   31  
  30   32  /*
  31   33   * An application should not include this header directly.  Instead it
  32   34   * should be included only through the inclusion of other Sun headers.
↓ open down ↓ 117 lines elided ↑ open up ↑
 150  152  #define FOPEN_MAX       _NFILE
 151  153  #define FILENAME_MAX    1024    /* max # of characters in a path name */
 152  154  
 153  155  #define SEEK_SET        0
 154  156  #define SEEK_CUR        1
 155  157  #define SEEK_END        2
 156  158  #define TMP_MAX         17576   /* 26 * 26 * 26 */
 157  159  
 158  160  #define L_tmpnam        25      /* (sizeof(P_tmpdir) + 15) */
 159  161  
 160      -#if defined(__STDC__)
 161  162  extern __FILE   __iob[_NFILE];
 162  163  #define stdin   (&__iob[0])
 163  164  #define stdout  (&__iob[1])
 164  165  #define stderr  (&__iob[2])
 165      -#else
 166      -extern __FILE   _iob[_NFILE];
 167      -#define stdin   (&_iob[0])
 168      -#define stdout  (&_iob[1])
 169      -#define stderr  (&_iob[2])
 170      -#endif  /* __STDC__ */
 171  166  
 172  167  #if __cplusplus >= 199711L
 173  168  namespace std {
 174  169  #endif
 175  170  
 176  171  #if !defined(_LP64) && !defined(_LONGLONG_TYPE)
 177  172  
 178  173  #ifdef __PRAGMA_REDEFINE_EXTNAME
 179  174  #pragma redefine_extname fprintf        _fprintf_c89
 180  175  #pragma redefine_extname printf         _printf_c89
↓ open down ↓ 11 lines elided ↑ open up ↑
 192  187  #define vfprintf        _vfprintf_c89
 193  188  #define vprintf         _vprintf_c89
 194  189  #define vsprintf        _vsprintf_c89
 195  190  #define fscanf          _fscanf_c89
 196  191  #define scanf           _scanf_c89
 197  192  #define sscanf          _sscanf_c89
 198  193  #endif
 199  194  
 200  195  #endif /* !defined(_LP64) && !defined(_LONGLONG_TYPE) */
 201  196  
 202      -#if defined(__STDC__)
 203      -
 204  197  extern int      remove(const char *);
 205  198  extern int      rename(const char *, const char *);
 206  199  extern FILE     *tmpfile(void);
 207  200  extern char     *tmpnam(char *);
 208  201  extern int      fclose(FILE *);
 209  202  extern int      fflush(FILE *);
 210  203  extern FILE     *fopen(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD);
 211  204  extern FILE     *freopen(const char *_RESTRICT_KYWD,
 212  205                          const char *_RESTRICT_KYWD, FILE *_RESTRICT_KYWD);
 213  206  extern void     setbuf(FILE *_RESTRICT_KYWD, char *_RESTRICT_KYWD);
↓ open down ↓ 51 lines elided ↑ open up ↑
 265  258  extern int      feof(FILE *);
 266  259  extern int      ferror(FILE *);
 267  260  #endif
 268  261  extern void     perror(const char *);
 269  262  
 270  263  #ifndef _LP64
 271  264  extern int      __filbuf(FILE *);
 272  265  extern int      __flsbuf(int, FILE *);
 273  266  #endif  /*      _LP64   */
 274  267  
 275      -#else   /* !defined __STDC__ */
 276      -
 277      -extern int      remove();
 278      -extern int      rename();
 279      -extern FILE     *tmpfile();
 280      -extern char     *tmpnam();
 281      -extern int      fclose();
 282      -extern int      fflush();
 283      -extern FILE     *fopen();
 284      -extern FILE     *freopen();
 285      -extern void     setbuf();
 286      -extern int      setvbuf();
 287      -extern int      fprintf();
 288      -extern int      fscanf();
 289      -extern int      printf();
 290      -extern int      scanf();
 291      -extern int      sprintf();
 292      -extern int      sscanf();
 293      -extern int      vfprintf();
 294      -extern int      vprintf();
 295      -extern int      vsprintf();
 296      -extern int      fgetc();
 297      -extern char     *fgets();
 298      -extern int      fputc();
 299      -extern int      fputs();
 300      -extern int      getc();
 301      -extern int      getchar();
 302      -extern char     *gets();
 303      -extern int      putc();
 304      -extern int      putchar();
 305      -extern int      puts();
 306      -extern int      ungetc();
 307      -extern size_t   fread();
 308      -extern size_t   fwrite();
 309      -extern int      fgetpos();
 310      -extern int      fseek();
 311      -extern int      fsetpos();
 312      -extern long     ftell();
 313      -extern void     rewind();
 314      -extern void     clearerr();
 315      -extern int      feof();
 316      -extern int      ferror();
 317      -extern void     perror();
 318      -
 319      -#ifndef _LP64
 320      -extern int      _filbuf();
 321      -extern int      _flsbuf();
 322      -#endif  /*      _LP64   */
 323      -
 324      -#endif  /* __STDC__ */
 325      -
 326  268  #if __cplusplus >= 199711L
 327  269  }
 328  270  #endif /* end of namespace std */
 329  271  
 330  272  #if !defined(__lint)
 331  273  
 332  274  #if     !defined(_REENTRANT) && !defined(_LP64)
 333  275  
 334      -#ifdef  __STDC__
 335  276  #if __cplusplus >= 199711L
 336  277  namespace std {
 337  278  inline int getc(FILE *_p) {
 338  279          return (--_p->_cnt < 0 ? __filbuf(_p) : (int)*_p->_ptr++); }
 339  280  inline int putc(int _x, FILE *_p) {
 340  281          return (--_p->_cnt < 0 ? __flsbuf(_x, _p)
 341  282                  : (int)(*_p->_ptr++ = (unsigned char) _x)); }
 342  283  }
 343  284  #else /* __cplusplus >= 199711L */
 344  285  #define getc(p)         (--(p)->_cnt < 0 ? __filbuf(p) : (int)*(p)->_ptr++)
 345  286  #define putc(x, p)      (--(p)->_cnt < 0 ? __flsbuf((x), (p)) \
 346  287                                  : (int)(*(p)->_ptr++ = (unsigned char) (x)))
 347  288  #endif /* __cplusplus >= 199711L */
 348      -#else /* __STDC__ */
 349      -#define getc(p)         (--(p)->_cnt < 0 ? _filbuf(p) : (int)*(p)->_ptr++)
 350      -#define putc(x, p)      (--(p)->_cnt < 0 ? _flsbuf((x), (p)) : \
 351      -                                (int)(*(p)->_ptr++ = (unsigned char) (x)))
 352      -#endif  /* __STDC__ */
 353  289  
 354  290  #endif /* !defined(_REENTRANT) && !defined(_LP64) */
 355  291  
 356  292  #ifndef _REENTRANT
 357  293  
 358  294  #if __cplusplus >= 199711L
 359  295  namespace std {
 360  296  inline int getchar() { return getc(stdin); }
 361  297  inline int putchar(int _x) { return putc(_x, stdout); }
 362  298  }
↓ open down ↓ 28 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX