Debian Codegraph @

podofo/3rdparty/adobe/afdko/include/safetime.h

raw
1 /*
2 Copyright 2019 Adobe. All Rights Reserved.
3 This software is licensed as OpenSource, under the Apache License, Version 2.0.
4 This license is available at: http://opensource.org/licenses/Apache-2.0.
5 */
6
7 #ifndef SAFETIME_H
8 #define SAFETIME_H
9
10 #ifdef _WIN32
11 #define SAFE_LOCALTIME(x, y) localtime_s(y, x)
12 #define LOCALTIME_FAILURE(x) (x != 0)
13 #define SAFE_CTIME(x, y) ctime_s(y, sizeof(y), x)
14 #define SAFE_GMTIME(x, y) gmtime_s(y, x)
15 #else
16 #define SAFE_LOCALTIME(x, y) localtime_r(x, y)
17 #define LOCALTIME_FAILURE(x) (x == NULL)
18 #define SAFE_CTIME(x, y) ctime_r(x, y)
19 #define SAFE_GMTIME(x, y) gmtime_r(x, y)
20 #endif /* WIN32 */
21
22 #endif /* SAFETIME_H */