| 1 | // Copyright (C) 2017 The Qt Company Ltd. |
| 2 | // Copyright (C) 2015 Intel Corporation. |
| 3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 4 | |
| 5 | #ifndef QTENVIRONMENTVARIABLES_P_H |
| 6 | #define QTENVIRONMENTVARIABLES_P_H |
| 7 | // Nothing but (tests and) ../time/qlocaltime.cpp should access this. |
| 8 | #if defined(__cplusplus) |
| 9 | |
| 10 | // |
| 11 | // W A R N I N G |
| 12 | // ------------- |
| 13 | // |
| 14 | // This file is not part of the Qt API. It exists purely as an implementation |
| 15 | // detail. This header file may change from version to version without notice, |
| 16 | // or even be removed. |
| 17 | // |
| 18 | // We mean it. |
| 19 | // |
| 20 | |
| 21 | #include "qglobal_p.h" |
| 22 | |
| 23 | #ifdef Q_CC_MINGW |
| 24 | # include <unistd.h> // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r() |
| 25 | #endif |
| 26 | #include <time.h> |
| 27 | |
| 28 | QT_BEGIN_NAMESPACE |
| 29 | |
| 30 | // These (behave as if they) consult the environment, so need to share its locking: |
| 31 | Q_CORE_EXPORT void qTzSet(); |
| 32 | Q_CORE_EXPORT time_t qMkTime(struct tm *when); |
| 33 | Q_CORE_EXPORT bool qLocalTime(time_t utc, struct tm *local); |
| 34 | Q_CORE_EXPORT QString qTzName(int dstIndex); |
| 35 | |
| 36 | QT_END_NAMESPACE |
| 37 | |
| 38 | #endif // defined(__cplusplus) |
| 39 | #endif // QTENVIRONMENTVARIABLES_P_H |
| 40 | |