Bug 1848242 - Mark basic.any.html subtest as intermittent. a=test-only
[gecko.git] / nsprpub / config / now.c
blob2893c5b7a14ab138b04958ff03c6b2c09e991e94
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include <stdio.h>
7 #include <time.h>
9 int main(int argc, char **argv)
11 #if defined(OMIT_LIB_BUILD_TIME)
13 * Some platforms don't have any 64-bit integer type
14 * such as 'long long'. Because we can't use NSPR's
15 * PR_snprintf in this program, it is difficult to
16 * print a static initializer for PRInt64 (a struct).
17 * So we print nothing. The makefiles that build the
18 * shared libraries will detect the empty output string
19 * of this program and omit the library build time
20 * in PRVersionDescription.
22 #elif defined(_MSC_VER)
23 __int64 now;
24 time_t sec;
26 sec = time(NULL);
27 now = (1000000i64) * sec;
28 fprintf(stdout, "%I64d", now);
29 #else
30 long long now;
31 time_t sec;
33 sec = time(NULL);
34 now = (1000000LL) * sec;
35 fprintf(stdout, "%lld", now);
36 #endif
38 return 0;
39 } /* main */
41 /* now.c */