Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/head/time.h
          +++ new/usr/src/head/time.h
↓ open down ↓ 15 lines elided ↑ open up ↑
  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  /*      Copyright (c) 1988 AT&T */
  22   22  /*        All Rights Reserved   */
  23   23  
  24   24  
  25   25  /*
       26 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
       27 + *
  26   28   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  27   29   * Use is subject to license terms.
  28   30   */
  29   31  /*
  30   32   * Copyright 2010 Nexenta Systems, Inc.  Al rights reserved.
  31      - * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  32   33   */
  33   34  
  34   35  #ifndef _TIME_H
  35   36  #define _TIME_H
  36   37  
  37   38  #include <sys/feature_tests.h>
  38   39  #include <iso/time_iso.h>
  39   40  #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
  40   41          (_POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__)
  41   42  #include <sys/types.h>
↓ open down ↓ 27 lines elided ↑ open up ↑
  69   70  #ifndef _CLOCKID_T
  70   71  #define _CLOCKID_T
  71   72  typedef int     clockid_t;
  72   73  #endif
  73   74  
  74   75  #ifndef _TIMER_T
  75   76  #define _TIMER_T
  76   77  typedef int     timer_t;
  77   78  #endif
  78   79  
  79      -#if defined(__STDC__)
  80      -
  81   80  #if defined(__EXTENSIONS__) || \
  82   81          (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
  83   82          (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
  84   83  extern struct tm *gmtime_r(const time_t *_RESTRICT_KYWD,
  85   84                          struct tm *_RESTRICT_KYWD);
  86   85  extern struct tm *localtime_r(const time_t *_RESTRICT_KYWD,
  87   86                          struct tm *_RESTRICT_KYWD);
  88   87  #endif
  89   88  
  90   89  #if (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
↓ open down ↓ 99 lines elided ↑ open up ↑
 190  189  extern struct tm *getdate(const char *);
 191  190  #ifdef  _REENTRANT
 192  191  #undef getdate_err
 193  192  #define getdate_err *(int *)_getdate_err_addr()
 194  193  extern int *_getdate_err_addr(void);
 195  194  #else
 196  195  extern int getdate_err;
 197  196  #endif /* _REENTRANT */
 198  197  #endif /* (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))... */
 199  198  
 200      -#else /* __STDC__ */
 201      -
 202      -extern int cftime(), ascftime();
 203      -extern void tzset();
 204      -extern time_t timegm();
 205      -
 206      -#ifdef _STRPTIME_DONTZERO
 207      -#ifdef __PRAGMA_REDEFINE_EXTNAME
 208      -#pragma redefine_extname strptime       __strptime_dontzero
 209      -#else   /* __PRAGMA_REDEFINE_EXTNAME */
 210      -extern char *__strptime_dontzero();
 211      -#define strptime        __strptime_dontzero
 212      -#endif  /* __PRAGMA_REDEFINE_EXTNAME */
 213      -#endif  /* _STRPTIME_DONTZERO */
 214      -
 215      -extern char *strptime();
 216      -
 217      -#if defined(__EXTENSIONS__) || \
 218      -        (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
 219      -        (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
 220      -extern struct tm *gmtime_r();
 221      -extern struct tm *localtime_r();
 222      -#endif
 223      -
 224      -extern long timezone, altzone;
 225      -extern int daylight;
 226      -extern char *tzname[2];
 227      -
 228      -#if !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2) || defined(__EXTENSIONS__)
 229      -extern struct tm *getdate();
 230      -#ifdef  _REENTRANT
 231      -#undef getdate_err
 232      -#define getdate_err *(int *)_getdate_err_addr()
 233      -extern int *_getdate_err_addr();
 234      -#else
 235      -extern int getdate_err;
 236      -#endif /* _REENTRANT */
 237      -#endif /* !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)... */
 238      -
 239      -#endif  /* __STDC__ */
 240      -
 241  199  /*
 242  200   * ctime_r() & asctime_r() prototypes are defined here.
 243  201   */
 244  202  
 245  203  /*
 246  204   * Previous releases of Solaris, starting at 2.3, provided definitions of
 247  205   * various functions as specified in POSIX.1c, Draft 6.  For some of these
 248  206   * functions, the final POSIX 1003.1c standard had a different number of
 249  207   * arguments and return values.
 250  208   *
↓ open down ↓ 20 lines elided ↑ open up ↑
 271  229   * #define in that case.
 272  230   *
 273  231   * NOTE: Support for the Draft 6 definitions is provided for compatibility
 274  232   * only.  New applications/libraries should use the standard definitions.
 275  233   */
 276  234  
 277  235  #if     defined(__EXTENSIONS__) || defined(_REENTRANT) || \
 278  236          (!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
 279  237          (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 280  238  
 281      -#if     defined(__STDC__)
 282      -
 283  239  #if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 284  240  
 285  241  #ifdef __PRAGMA_REDEFINE_EXTNAME
 286  242  #pragma redefine_extname ctime_r __posix_ctime_r
 287  243  #pragma redefine_extname asctime_r __posix_asctime_r
 288  244  extern char *asctime_r(const struct tm *_RESTRICT_KYWD, char *_RESTRICT_KYWD);
 289  245  extern char *ctime_r(const time_t *, char *);
 290  246  #else  /* __PRAGMA_REDEFINE_EXTNAME */
 291  247  
 292  248  extern char *__posix_asctime_r(const struct tm *_RESTRICT_KYWD,
↓ open down ↓ 22 lines elided ↑ open up ↑
 315  271  #endif /* !__lint */
 316  272  #endif /* __PRAGMA_REDEFINE_EXTNAME */
 317  273  
 318  274  #else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 319  275  
 320  276  extern char *asctime_r(const struct tm *, char *, int);
 321  277  extern char *ctime_r(const time_t *, char *, int);
 322  278  
 323  279  #endif  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 324  280  
 325      -#else  /* __STDC__ */
 326      -
 327      -#if     (_POSIX_C_SOURCE - 0 >= 199506L) || defined(_POSIX_PTHREAD_SEMANTICS)
 328      -
 329      -#ifdef __PRAGMA_REDEFINE_EXTNAME
 330      -#pragma redefine_extname asctime_r __posix_asctime_r
 331      -#pragma redefine_extname ctime_r __posix_ctime_r
 332      -extern char *asctime_r();
 333      -extern char *ctime_r();
 334      -#else  /* __PRAGMA_REDEFINE_EXTNAME */
 335      -
 336      -extern char *__posix_asctime_r();
 337      -extern char *__posix_ctime_r();
 338      -
 339      -#ifdef  __lint
 340      -
 341      -#define asctime_r __posix_asctime_r
 342      -#define ctime_r __posix_ctime_r
 343      -
 344      -#else   /* !__lint */
 345      -
 346      -static char *
 347      -asctime_r(__tm, __buf)
 348      -        struct tm *__tm;
 349      -        char *__buf;
 350      -{
 351      -        return (__posix_asctime_r(__tm, __buf));
 352      -}
 353      -static char *
 354      -ctime_r(__time, __buf)
 355      -        time_t *__time;
 356      -        char *__buf;
 357      -{
 358      -        return (__posix_ctime_r(__time, __buf));
 359      -}
 360      -
 361      -#endif /* !__lint */
 362      -#endif /* __PRAGMA_REDEFINE_EXTNAME */
 363      -
 364      -#else  /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 365      -
 366      -extern char *asctime_r();
 367      -extern char *ctime_r();
 368      -
 369      -#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
 370      -
 371      -#endif /* __STDC__ */
 372      -
 373  281  #endif /* defined(__EXTENSIONS__) || defined(_REENTRANT)... */
 374  282  
 375  283  
 376  284  #if defined(_XPG7) || !defined(_STRICT_SYMBOLS)
 377  285  
 378  286  #ifndef _LOCALE_T
 379  287  #define _LOCALE_T
 380  288  typedef struct _locale *locale_t;
 381  289  #endif
 382  290  
 383      -#if     defined(__STDC__)
 384  291  extern size_t strftime_l(char *_RESTRICT_KYWD, size_t,
 385  292          const char *_RESTRICT_KYWD, const struct tm *_RESTRICT_KYWD, locale_t);
 386      -#else /* __STDC__ */
 387      -extern size_t strftime_l();
 388      -#endif /* __STDC__ */
 389  293  
 390  294  #endif /* defined(_XPG7) || !defined(_STRICT_SYMBOLS) */
 391  295  
 392  296  #ifdef  __cplusplus
 393  297  }
 394  298  #endif
 395  299  
 396  300  #endif  /* _TIME_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX