41
Development / Re: %I64d or %lld in the plugins\compilergcc\depslib\src\cache.c
« Last post by Wkerry on February 04, 2025, 08:39:58 am »Try the following:
#if (_USE_LONG_TIME_T)
sscanf(buf, "%ld %n", &timeval, &n);
#else
#if defined(PRId64)
sscanf(buf, "%" PRId64 " %n", &timeval, &n);
#else
sscanf(buf, "%lld %n", &timeval, &n);
#endif
#endif
and
#if (_USE_LONG_TIME_T)
fprintf(f, "%ld %s\n", h->time, h->file);
#else
#if defined(PRId64)
fprintf(f, "%" PRId64 " %s\n", h->time, h->file);
#else
fprintf(f, "%lld %s\n", h->time, h->file);
#endif
#endif
This works better than the existing code. Give it a quick hack/ try, but you may find a better way.
#if (_USE_LONG_TIME_T)
sscanf(buf, "%ld %n", &timeval, &n);
#else
#if defined(PRId64)
sscanf(buf, "%" PRId64 " %n", &timeval, &n);
#else
sscanf(buf, "%lld %n", &timeval, &n);
#endif
#endif
and
#if (_USE_LONG_TIME_T)
fprintf(f, "%ld %s\n", h->time, h->file);
#else
#if defined(PRId64)
fprintf(f, "%" PRId64 " %s\n", h->time, h->file);
#else
fprintf(f, "%lld %s\n", h->time, h->file);
#endif
#endif
This works better than the existing code. Give it a quick hack/ try, but you may find a better way.