Cleanup suseconds_t usage

This commit is contained in:
Sergey Lyubka 2022-01-14 12:33:06 +00:00
parent c53e2fcc14
commit 216427cea0
4 changed files with 6 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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