michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: int main(int argc, char **argv) michael@0: { michael@0: #if defined(OMIT_LIB_BUILD_TIME) michael@0: /* michael@0: * Some platforms don't have any 64-bit integer type michael@0: * such as 'long long'. Because we can't use NSPR's michael@0: * PR_snprintf in this program, it is difficult to michael@0: * print a static initializer for PRInt64 (a struct). michael@0: * So we print nothing. The makefiles that build the michael@0: * shared libraries will detect the empty output string michael@0: * of this program and omit the library build time michael@0: * in PRVersionDescription. michael@0: */ michael@0: #elif defined(_MSC_VER) michael@0: __int64 now; michael@0: time_t sec; michael@0: michael@0: sec = time(NULL); michael@0: now = (1000000i64) * sec; michael@0: fprintf(stdout, "%I64d", now); michael@0: #else michael@0: long long now; michael@0: time_t sec; michael@0: michael@0: sec = time(NULL); michael@0: now = (1000000LL) * sec; michael@0: fprintf(stdout, "%lld", now); michael@0: #endif michael@0: michael@0: return 0; michael@0: } /* main */ michael@0: michael@0: /* now.c */