opnsense-src/contrib/ofed/usr.lib/libibverbs/alloca.h
2011-03-21 09:58:24 +00:00

18 lines
359 B
C

#ifndef _LIBIBVERBS_ALLOCA_H_
#define _LIBIBVERBS_ALLOCA_H_
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#define strdupa(_s) \
({ \
char *_d; \
int _len; \
\
_len = strlen(_s) + 1; \
_d = alloca(_len); \
if (_d) \
memcpy(_d, _s, _len); \
_d; \
})
#endif /* _LIBIBVERBS_ALLOCA_H_ */