Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/head/dirent.h
          +++ new/usr/src/head/dirent.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
       23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
       24 + *
  23   25   * Copyright 2007 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  #ifndef _DIRENT_H
  31   33  #define _DIRENT_H
  32   34  
  33      -#pragma ident   "%Z%%M% %I%     %E% SMI"        /* SVr4.0 1.6.1.5   */
  34      -
  35   35  #include <sys/feature_tests.h>
  36   36  
  37   37  #include <sys/types.h>
  38   38  #include <sys/dirent.h>
  39   39  
  40   40  #ifdef  __cplusplus
  41   41  extern "C" {
  42   42  #endif
  43   43  
  44   44  #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
↓ open down ↓ 17 lines elided ↑ open up ↑
  62   62  
  63   63  typedef struct {
  64   64          int     d_fd;           /* file descriptor */
  65   65          int     d_loc;          /* offset in block */
  66   66          int     d_size;         /* amount of valid data */
  67   67          char    *d_buf;         /* directory block */
  68   68  } DIR;                          /* stream data from opendir() */
  69   69  
  70   70  #endif /* !defined(__XOPEN_OR_POSIX) */
  71   71  
  72      -#if defined(__STDC__)
  73      -
  74   72  /* large file compilation environment setup */
  75   73  #if !defined(_LP64) && _FILE_OFFSET_BITS == 64
  76   74  #ifdef __PRAGMA_REDEFINE_EXTNAME
  77   75  #pragma redefine_extname        readdir readdir64
  78   76  #pragma redefine_extname        scandir scandir64
  79   77  #pragma redefine_extname        alphasort alphasort64
  80   78  #else
  81   79  #define readdir                 readdir64
  82   80  #define scandir                 scandir64
  83   81  #define alphasort               alphasort64
↓ open down ↓ 42 lines elided ↑ open up ↑
 126  124  extern struct dirent64  *readdir64(DIR *);
 127  125  #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
 128  126  extern int      scandir64(const char *, struct dirent64 *(*[]),
 129  127                          int (*)(const struct dirent64 *),
 130  128                          int (*)(const struct dirent64 **,
 131  129                                  const struct dirent64 **));
 132  130  extern int      alphasort64(const struct dirent64 **, const struct dirent64 **);
 133  131  #endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) */
 134  132  #endif
 135  133  
 136      -#else
 137      -
 138      -extern DIR              *opendir();
 139      -#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
 140      -        defined(_ATFILE_SOURCE)
 141      -extern DIR              *fdopendir();
 142      -extern int              dirfd();
 143      -#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
 144      -extern struct dirent    *readdir();
 145  134  #if defined(__EXTENSIONS__) || !defined(_POSIX_C_SOURCE) || \
 146  135          defined(_XOPEN_SOURCE)
 147      -extern long             telldir();
 148      -extern void             seekdir();
 149      -#endif /* defined(__EXTENSIONS__) || !defined(_POSIX_C_SOURCE) ... */
 150      -extern void             rewinddir();
 151      -extern int              closedir();
 152      -
 153      -/* transitional large file interface */
 154      -#if     defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
 155      -            !defined(__PRAGMA_REDEFINE_EXTNAME))
 156      -extern struct dirent64  *readdir64();
 157      -#endif
 158      -
 159      -#endif
 160      -
 161      -#if defined(__EXTENSIONS__) || !defined(_POSIX_C_SOURCE) || \
 162      -        defined(_XOPEN_SOURCE)
 163  136  #define rewinddir(dirp) seekdir(dirp, 0L)
 164  137  #endif
 165  138  
 166  139  /*
 167  140   * readdir_r() prototype is defined here.
 168  141   *
 169  142   * There are several variations, depending on whether compatibility with old
 170  143   * POSIX draft specifications or the final specification is desired and on
 171  144   * whether the large file compilation environment is active.  To combat a
 172  145   * combinatorial explosion, enabling large files implies using the final
↓ open down ↓ 2 lines elided ↑ open up ↑
 175  148   *
 176  149   * In the LP64 compilation environment, all APIs are already large file,
 177  150   * and since there are no 64-bit applications that can have seen the
 178  151   * draft implementation, again, we use the final POSIX specification.
 179  152   */
 180  153  
 181  154  #if     defined(__EXTENSIONS__) || defined(_REENTRANT) || \
 182  155          !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE - 0 >= 199506L) || \
 183  156          defined(_POSIX_PTHREAD_SEMANTICS)
 184  157  
 185      -#if     defined(__STDC__)
 186      -
 187  158  #if     !defined(_LP64) && _FILE_OFFSET_BITS == 32
 188  159  
 189  160  #if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 190  161  
 191  162  #ifdef  __PRAGMA_REDEFINE_EXTNAME
 192  163  #pragma redefine_extname readdir_r      __posix_readdir_r
 193  164  extern int readdir_r(DIR *_RESTRICT_KYWD, struct dirent *_RESTRICT_KYWD,
 194  165                  struct dirent **_RESTRICT_KYWD);
 195  166  #else   /* __PRAGMA_REDEFINE_EXTNAME */
 196  167  
↓ open down ↓ 39 lines elided ↑ open up ↑
 236  207  
 237  208  #endif  /* !_LP64 && _FILE_OFFSET_BITS == 32 */
 238  209  
 239  210  #if     defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
 240  211              !defined(__PRAGMA_REDEFINE_EXTNAME))
 241  212  /* transitional large file interface */
 242  213  extern int readdir64_r(DIR *_RESTRICT_KYWD, struct dirent64 *_RESTRICT_KYWD,
 243  214          struct dirent64 **_RESTRICT_KYWD);
 244  215  #endif
 245  216  
 246      -#else  /* __STDC__ */
 247      -
 248      -#if     !defined(_LP64) && _FILE_OFFSET_BITS == 32
 249      -
 250      -#if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 251      -
 252      -#ifdef __PRAGMA_REDEFINE_EXTNAME
 253      -#pragma redefine_extname readdir_r __posix_readdir_r
 254      -extern int readdir_r();
 255      -#else  /* __PRAGMA_REDEFINE_EXTNAME */
 256      -
 257      -extern int __posix_readdir_r();
 258      -
 259      -#ifdef  __lint
 260      -#define readdir_r __posix_readdir_r
 261      -#else   /* !__lint */
 262      -
 263      -static int
 264      -readdir_r(DIR *_RESTRICT_KYWD __dp, struct dirent *_RESTRICT_KYWD __ent,
 265      -        struct dirent **_RESTRICT_KYWD __res)
 266      -{
 267      -        return (__posix_readdir_r(__dp, __ent, __res));
 268      -}
 269      -
 270      -#endif /* !__lint */
 271      -#endif /* __PRAGMA_REDEFINE_EXTNAME */
 272      -
 273      -#else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 274      -
 275      -extern struct dirent *readdir_r();
 276      -
 277      -#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 278      -
 279      -#else   /* !_LP64 && _FILE_OFFSET_BITS == 32 */
 280      -
 281      -#if defined(_LP64)
 282      -#ifdef  __PRAGMA_REDEFINE_EXTNAME
 283      -#pragma redefine_extname readdir64_r    readdir_r
 284      -#else
 285      -#define readdir64_r     readdir
 286      -#endif
 287      -#else   /* _LP64 */
 288      -#ifdef  __PRAGMA_REDEFINE_EXTNAME
 289      -#pragma redefine_extname readdir_r readdir64_r
 290      -#else
 291      -#define readdir_r readdir64_r
 292      -#endif
 293      -#endif  /* _LP64 */
 294      -extern int      readdir_r();
 295      -
 296      -#endif  /* !_LP64 && _FILE_OFFSET_BITS == 32 */
 297      -
 298      -#if     defined(_LARGEFILE64_SOURCE) && !((_FILE_OFFSET_BITS == 64) && \
 299      -            !defined(__PRAGMA_REDEFINE_EXTNAME))
 300      -/* transitional large file interface */
 301      -extern int      readdir64_r();
 302      -#endif
 303      -
 304      -#endif /* __STDC__ */
 305      -
 306  217  #endif /* defined(__EXTENSIONS__) || defined(_REENTRANT)... */
 307  218  
 308  219  #ifdef  __cplusplus
 309  220  }
 310  221  #endif
 311  222  
 312  223  #endif  /* _DIRENT_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX