Force nightly fresh external files

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7324 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2021-09-14 22:42:37 +00:00
parent 4d26045274
commit c06f69163d
9 changed files with 121 additions and 16 deletions

View file

@ -2,6 +2,7 @@
* misc.c: miscellaneous useful items
*/
#include <string.h>
#include <time.h>
#include "halibut.h"
struct stackTag {
@ -355,3 +356,21 @@ void wrap_free(wrappedline * w)
w = t;
}
}
unsigned long getutcunixtime()
{
#ifndef _WIN32
struct timespec ts;
ts.tv_sec = 0;
/* gettimeofday()? */
#if (_XOPEN_SOURCE >= 500 || _POSIX_C_SOURCE >= 199309L)
if (0 == clock_gettime(CLOCK_REALTIME, &ts))
return ts.tv_sec;
#endif
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
if (timespec_get(&ts, TIME_UTC)) /* implementation defined epoch :( */
return ts.tv_sec;
#endif
#endif /*~ _WIN32 */
return (unsigned long) time(NULL);
}