diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/socket.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/socket.h b/src/common/socket.h index b9e6f6f42..947ea8d3e 100644 --- a/src/common/socket.h +++ b/src/common/socket.h @@ -85,7 +85,12 @@ struct config_setting_t; #define WP2PTR(fd) WFIFO2PTR(fd) // buffer I/O macros -#define RBUFP(p,pos) (((const uint8 *)(p)) + (pos)) +static inline const void *RBUFP_(const void *p, int pos) __attribute__((const, unused)); +static inline const void *RBUFP_(const void *p, int pos) +{ + return ((const uint8 *)p) + pos; +} +#define RBUFP(p,pos) RBUFP_(p, (int)(pos)) #define RBUFB(p,pos) (*(const uint8 *)RBUFP((p),(pos))) #define RBUFW(p,pos) (*(const uint16 *)RBUFP((p),(pos))) #define RBUFL(p,pos) (*(const uint32 *)RBUFP((p),(pos))) |