forked from dleonard0/pktstat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompat.h
More file actions
35 lines (29 loc) · 804 Bytes
/
compat.h
File metadata and controls
35 lines (29 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "type.h"
#if DEBUG_MALLOC
#include <stdlib.h>
#include <string.h>
void *xx_malloc(size_t, const char *, int);
void *xx_realloc(void *, size_t, const char *, int);
void xx_free(void *);
char *xx_strdup(const char *s, const char *, int);
#define malloc(sz) xx_malloc(sz,__FILE__,__LINE__)
#define realloc(ptr,sz) xx_realloc(ptr,sz,__FILE__,__LINE__)
#define free xx_free
#define strdup(s) xx_strdup(s,__FILE__,__LINE__)
#endif
#if !HAVE_MEMCMP
int memcmp(const void *, const void *, size_t);
#endif
#if HAVE_ERR_H
# include <err.h>
#else
# if !HAVE_ERR
void err(int, const char *, ...);
void errx(int, const char *, ...);
void warn(const char *, ...);
void warnx(const char *, ...);
# endif
#endif
#if !HAVE_STRNCPY
size_t strlcpy(char *, const char *, size_t);
#endif