[BACK]Return to test-strptime.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Annotation of mandoc/test-strptime.c, Revision 1.3

1.1       kristaps    1: #if defined(__linux__) || defined(__MINT__)
1.2       schwarze    2: # define _GNU_SOURCE /* strptime() */
1.1       kristaps    3: #endif
                      4:
                      5: #include <time.h>
                      6:
                      7: int
1.2       schwarze    8: main(void)
1.1       kristaps    9: {
                     10:        struct tm tm;
1.2       schwarze   11:        const char input[] = "2014-01-04";
1.3     ! schwarze   12:        return ! (strptime(input, "%Y-%m-%d", &tm) == input + 10 &&
        !            13:            tm.tm_year == 114 && tm.tm_mon == 0 && tm.tm_mday == 4);
1.1       kristaps   14: }

CVSweb