X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fdropin.h;h=6fa7a9dda3d0440f00fe2e5c7404544f9aa574d9;hb=ce4d55b72fd4290d4710f10e755f6dd9ed039d88;hp=384b4dbf54e74de2522c16b17e85a7a10391673b;hpb=b9a7444b9fa216d16d91f34d2e12f51fc4d60e46;p=tinc diff --git a/src/dropin.h b/src/dropin.h index 384b4dbf..6fa7a9dd 100644 --- a/src/dropin.h +++ b/src/dropin.h @@ -26,8 +26,8 @@ extern int daemon(int, int); #endif #ifndef HAVE_ASPRINTF -extern int asprintf(char **, const char *, ...); -extern int vasprintf(char **, const char *, va_list ap); +extern int asprintf(char **, const char *, ...) ATTR_FORMAT(printf, 2, 3); +extern int vasprintf(char **, const char *, va_list ap) ATTR_FORMAT(printf, 2, 0); #endif #ifndef HAVE_GETTIMEOFDAY @@ -71,11 +71,15 @@ extern int gettimeofday(struct timeval *, void *); #define MAX(a,b) (((a)>(b))?(a):(b)) #endif +#define CLAMP(val, min, max) MIN((max), MAX((min), (val))) + #ifdef _MSC_VER #define PATH_MAX MAX_PATH #define strcasecmp _stricmp #define strncasecmp _strnicmp +#define isatty _isatty +#define fileno _fileno #define close CloseHandle #define __const const