/*---------------------------------------------------------------------------
 * leap_seconds.h - Leap seconds include for DateTime::Lite
 *
 * This file is auto-generated by scripts/leap_seconds_header.pl (v0.1.0)
 * from DateTime::Lite distribution on 2026-04-09T04:37:36+00:00.
 *
 * Do not edit this file directly. To regenerate, run:
 *
 *    perl scripts/leap_seconds_header.pl [leap-seconds.list] [leap_seconds.h]
 *
 * The leap-seconds.list source file is distributed with the IANA tzdata
 * release and is typically found at /usr/share/zoneinfo/leap-seconds.list, or
 * downloadedable from https://data.iana.org/time-zones/data/leap-seconds.list
 *
 * This IERS leap-seconds.list source file is in the public domain:
 *   "This file is in the public domain."
 *   (https://data.iana.org/time-zones/data/leap-seconds.list)
 * 
 * This program is free software; you can redistribute  it  and/or  modify  it
 * under the same terms as Perl itself.
 *---------------------------------------------------------------------------*/


/* utc_rd must be a simple variable */
#define SET_LEAP_SECONDS(utc_rd, leaps)  \
  (leaps) =                              \
    utc_rd >= 736330 ? 27 :              \
    utc_rd >= 735780 ? 26 :              \
    utc_rd >= 734685 ? 25 :              \
    utc_rd >= 733408 ? 24 :              \
    utc_rd >= 732312 ? 23 :              \
    utc_rd >= 729755 ? 22 :              \
    utc_rd >= 729206 ? 21 :              \
    utc_rd >= 728659 ? 20 :              \
    utc_rd >= 728110 ? 19 :              \
    utc_rd >= 727745 ? 18 :              \
    utc_rd >= 727380 ? 17 :              \
    utc_rd >= 726833 ? 16 :              \
    utc_rd >= 726468 ? 15 :              \
    utc_rd >= 725737 ? 14 :              \
    utc_rd >= 724823 ? 13 :              \
    utc_rd >= 724092 ? 12 :              \
    utc_rd >= 723727 ? 11 :              \
    utc_rd >= 723362 ? 10 :              \
    utc_rd >= 722815 ? 9 :               \
    utc_rd >= 722450 ? 8 :               \
    utc_rd >= 722085 ? 7 :               \
    utc_rd >= 721720 ? 6 :               \
    utc_rd >= 721354 ? 5 :               \
    utc_rd >= 720989 ? 4 :               \
    utc_rd >= 720624 ? 3 :               \
    utc_rd >= 720259 ? 2 :               \
    utc_rd >= 720075 ? 1 :               \
    0;                                   \

#define SET_EXTRA_SECONDS(utc_rd, es)    \
    switch (utc_rd +1) {                 \
    case 720075: es = +1; break;         \
    case 720259: es = +1; break;         \
    case 720624: es = +1; break;         \
    case 720989: es = +1; break;         \
    case 721354: es = +1; break;         \
    case 721720: es = +1; break;         \
    case 722085: es = +1; break;         \
    case 722450: es = +1; break;         \
    case 722815: es = +1; break;         \
    case 723362: es = +1; break;         \
    case 723727: es = +1; break;         \
    case 724092: es = +1; break;         \
    case 724823: es = +1; break;         \
    case 725737: es = +1; break;         \
    case 726468: es = +1; break;         \
    case 726833: es = +1; break;         \
    case 727380: es = +1; break;         \
    case 727745: es = +1; break;         \
    case 728110: es = +1; break;         \
    case 728659: es = +1; break;         \
    case 729206: es = +1; break;         \
    case 729755: es = +1; break;         \
    case 732312: es = +1; break;         \
    case 733408: es = +1; break;         \
    case 734685: es = +1; break;         \
    case 735780: es = +1; break;         \
    case 736330: es = +1; break;         \
    default:     es =  0; break;         \
    }

/* day length in seconds (86400 or 86401) */
#define SET_DAY_LENGTH(utc_rd, dl)       \
    {                                    \
        IV es;                           \
        SET_EXTRA_SECONDS(utc_rd, es);   \
        dl = SECONDS_PER_DAY + es;       \
    }
