mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-26 22:41:03 +08:00
Fix localtime_r and gmtmime_r signatures
This commit is contained in:
parent
456e8bd249
commit
6c79a406cd
27
mongoose.h
27
mongoose.h
@ -77,21 +77,21 @@ extern "C" {
|
||||
#if MG_ARCH == MG_ARCH_AZURERTOS
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <tx_api.h>
|
||||
#include <fx_api.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <fx_api.h>
|
||||
#include <tx_api.h>
|
||||
|
||||
#include <tx_port.h>
|
||||
#include <nx_port.h>
|
||||
#include <nx_api.h>
|
||||
#include <nx_bsd.h>
|
||||
#include <nx_port.h>
|
||||
#include <tx_port.h>
|
||||
|
||||
#ifdef __REDLIB__
|
||||
#define va_copy(d,s)__builtin_va_copy(d,s)
|
||||
#define va_copy(d, s) __builtin_va_copy(d, s)
|
||||
#endif
|
||||
|
||||
#define PATH_MAX FX_MAXIMUM_PATH
|
||||
@ -102,9 +102,10 @@ extern "C" {
|
||||
#define gmtime_r(a, b) gmtime(a)
|
||||
#define MG_INT64_FMT "%lld"
|
||||
|
||||
static __inline struct tm *localtime_r(time_t *t, struct tm *tm) {
|
||||
(void) tm;
|
||||
return localtime(t);
|
||||
static __inline struct tm *localtime_r(const time_t *t, struct tm *tm) {
|
||||
struct tm *x = localtime(t);
|
||||
*tm = *x;
|
||||
return tm;
|
||||
}
|
||||
|
||||
#undef FOPEN_MAX
|
||||
@ -428,13 +429,13 @@ typedef int socklen_t;
|
||||
#endif
|
||||
|
||||
// https://lgtm.com/rules/2154840805/ -gmtime, localtime, ctime and asctime
|
||||
static __inline struct tm *gmtime_r(time_t *t, struct tm *tm) {
|
||||
static __inline struct tm *gmtime_r(const time_t *t, struct tm *tm) {
|
||||
struct tm *x = gmtime(t);
|
||||
*tm = *x;
|
||||
return tm;
|
||||
}
|
||||
|
||||
static __inline struct tm *localtime_r(time_t *t, struct tm *tm) {
|
||||
static __inline struct tm *localtime_r(const time_t *t, struct tm *tm) {
|
||||
struct tm *x = localtime(t);
|
||||
*tm = *x;
|
||||
return tm;
|
||||
|
@ -3,21 +3,21 @@
|
||||
#if MG_ARCH == MG_ARCH_AZURERTOS
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <tx_api.h>
|
||||
#include <fx_api.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <fx_api.h>
|
||||
#include <tx_api.h>
|
||||
|
||||
#include <tx_port.h>
|
||||
#include <nx_port.h>
|
||||
#include <nx_api.h>
|
||||
#include <nx_bsd.h>
|
||||
#include <nx_port.h>
|
||||
#include <tx_port.h>
|
||||
|
||||
#ifdef __REDLIB__
|
||||
#define va_copy(d,s)__builtin_va_copy(d,s)
|
||||
#define va_copy(d, s) __builtin_va_copy(d, s)
|
||||
#endif
|
||||
|
||||
#define PATH_MAX FX_MAXIMUM_PATH
|
||||
@ -28,9 +28,10 @@
|
||||
#define gmtime_r(a, b) gmtime(a)
|
||||
#define MG_INT64_FMT "%lld"
|
||||
|
||||
static __inline struct tm *localtime_r(time_t *t, struct tm *tm) {
|
||||
(void) tm;
|
||||
return localtime(t);
|
||||
static __inline struct tm *localtime_r(const time_t *t, struct tm *tm) {
|
||||
struct tm *x = localtime(t);
|
||||
*tm = *x;
|
||||
return tm;
|
||||
}
|
||||
|
||||
#undef FOPEN_MAX
|
||||
|
@ -90,13 +90,13 @@ typedef int socklen_t;
|
||||
#endif
|
||||
|
||||
// https://lgtm.com/rules/2154840805/ -gmtime, localtime, ctime and asctime
|
||||
static __inline struct tm *gmtime_r(time_t *t, struct tm *tm) {
|
||||
static __inline struct tm *gmtime_r(const time_t *t, struct tm *tm) {
|
||||
struct tm *x = gmtime(t);
|
||||
*tm = *x;
|
||||
return tm;
|
||||
}
|
||||
|
||||
static __inline struct tm *localtime_r(time_t *t, struct tm *tm) {
|
||||
static __inline struct tm *localtime_r(const time_t *t, struct tm *tm) {
|
||||
struct tm *x = localtime(t);
|
||||
*tm = *x;
|
||||
return tm;
|
||||
|
Loading…
x
Reference in New Issue
Block a user