mktime-internal.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* mktime variant that also uses an offset guess
  2. Copyright 2016-2017 Free Software Foundation, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public
  5. License as published by the Free Software Foundation; either
  6. version 3 of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. General Public License for more details.
  11. You should have received a copy of the GNU General Public
  12. License along with this program; if not, see
  13. <http://www.gnu.org/licenses/>. */
  14. #include <time.h>
  15. /* mktime_offset_t is a signed type wide enough to hold a UTC offset
  16. in seconds, and used as part of the type of the offset-guess
  17. argument to mktime_internal. Use time_t on platforms where time_t
  18. is signed, to be compatible with platforms like BeOS that export
  19. this implementation detail of mktime. On platforms where time_t is
  20. unsigned, GNU and POSIX code can assume 'int' is at least 32 bits
  21. which is wide enough for a UTC offset. */
  22. #if TIME_T_IS_SIGNED
  23. typedef time_t mktime_offset_t;
  24. #else
  25. typedef int mktime_offset_t;
  26. #endif
  27. time_t mktime_internal (struct tm *,
  28. struct tm * (*) (time_t const *, struct tm *),
  29. mktime_offset_t *);