mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-27 06:51:04 +08:00
Cleanup suseconds_t usage
This commit is contained in:
parent
c53e2fcc14
commit
216427cea0
@ -168,17 +168,16 @@ static __inline struct tm *localtime_r(const time_t *t, struct tm *tm) {
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
typedef long suseconds_t;
|
|
||||||
struct timeval {
|
struct timeval {
|
||||||
time_t tv_sec;
|
time_t tv_sec;
|
||||||
suseconds_t tv_usec;
|
long tv_usec;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -278,10 +277,9 @@ static inline void *mg_calloc(int cnt, size_t size) {
|
|||||||
|
|
||||||
#if !defined(__GNUC__)
|
#if !defined(__GNUC__)
|
||||||
// copied from GCC on ARM; for some reason useconds are signed
|
// copied from GCC on ARM; for some reason useconds are signed
|
||||||
typedef long suseconds_t;
|
|
||||||
struct timeval {
|
struct timeval {
|
||||||
time_t tv_sec;
|
time_t tv_sec;
|
||||||
suseconds_t tv_usec;
|
long tv_usec;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -395,7 +393,6 @@ typedef enum { false = 0, true = 1 } bool;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef unsigned suseconds_t;
|
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#define MG_DIRSEP '\\'
|
#define MG_DIRSEP '\\'
|
||||||
#ifndef PATH_MAX
|
#ifndef PATH_MAX
|
||||||
|
@ -5,17 +5,16 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
typedef long suseconds_t;
|
|
||||||
struct timeval {
|
struct timeval {
|
||||||
time_t tv_sec;
|
time_t tv_sec;
|
||||||
suseconds_t tv_usec;
|
long tv_usec;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -61,10 +61,9 @@ static inline void *mg_calloc(int cnt, size_t size) {
|
|||||||
|
|
||||||
#if !defined(__GNUC__)
|
#if !defined(__GNUC__)
|
||||||
// copied from GCC on ARM; for some reason useconds are signed
|
// copied from GCC on ARM; for some reason useconds are signed
|
||||||
typedef long suseconds_t;
|
|
||||||
struct timeval {
|
struct timeval {
|
||||||
time_t tv_sec;
|
time_t tv_sec;
|
||||||
suseconds_t tv_usec;
|
long tv_usec;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -56,7 +56,6 @@ typedef enum { false = 0, true = 1 } bool;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef unsigned suseconds_t;
|
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
#define MG_DIRSEP '\\'
|
#define MG_DIRSEP '\\'
|
||||||
#ifndef PATH_MAX
|
#ifndef PATH_MAX
|
||||||
|
Loading…
x
Reference in New Issue
Block a user