Changeset 212 in Main for trunk/Server/strptime.c


Ignore:
Timestamp:
Oct 3, 2024, 2:44:55 AM (6 weeks ago)
Author:
Nishi
Message:

compiles on vc6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Server/strptime.c

    r182 r212  
    3636//__RCSID("$NetBSD: strptime.c,v 1.62 2017/08/24 01:01:09 ginsbach Exp $");
    3737
    38 #if defined(__MINGW32__)
     38#if defined(__MINGW32__) || defined(_MSC_VER)
    3939
    4040#include <ctype.h>
     
    292292        case 'D':       /* The date as "%y/%m/%d". */
    293293        {
     294            int year;
    294295            new_fmt = HERE_D_FMT;
    295296            LEGAL_ALT(0);
    296297            state |= S_MON | S_MDAY | S_YEAR;
    297             const int year = split_year ? tm->tm_year : 0;
     298            year = split_year ? tm->tm_year : 0;
    298299
    299300            bp = (const unsigned char *)strptime((const char *)bp,
     
    399400
    400401#ifndef TIME_MAX
     402#ifdef _MSC_VER
     403#define TIME_MAX        INT32_MAX
     404#else
    401405#define TIME_MAX        INT64_MAX
     406#endif
    402407#endif
    403408        case 's':       /* seconds since the epoch */
    404409            {
    405410                time_t sse = 0;
     411#ifdef _MSC_VER
     412                uint32_t rulim = TIME_MAX;
     413#else
    406414                uint64_t rulim = TIME_MAX;
     415#endif
    407416
    408417                if (*bp < '0' || *bp > '9') {
     
    417426                } while ((sse * 10 <= TIME_MAX) &&
    418427                     rulim && *bp >= '0' && *bp <= '9');
    419 
     428#ifdef _MSC_VER
     429                if (sse < 0 || (uint32_t)sse > TIME_MAX) {
     430#else
    420431                if (sse < 0 || (uint64_t)sse > TIME_MAX) {
     432#endif
    421433                    bp = NULL;
    422434                    continue;
    423435                }
    424436#ifdef _WIN32
     437#ifdef _MSC_VER
     438                if (1)
     439#else
    425440                if (localtime_s(tm, &sse) == 0)
     441#endif
    426442#else
    427443                if (localtime_r(&sse, tm))
Note: See TracChangeset for help on using the changeset viewer.