]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ofed/usr.lib/libibverbs/alloca.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ofed / usr.lib / libibverbs / alloca.h
1 #ifndef _LIBIBVERBS_ALLOCA_H_
2 #define _LIBIBVERBS_ALLOCA_H_
3 #include <stdlib.h>
4 #include <string.h>
5 #include <stdlib.h>
6
7 #define strdupa(_s)                                             \
8 ({                                                              \
9         char *_d;                                               \
10         int _len;                                               \
11                                                                 \
12         _len = strlen(_s) + 1;                                  \
13         _d = alloca(_len);                                      \
14         if (_d)                                                 \
15                 memcpy(_d, _s, _len);                           \
16         _d;                                                     \
17 })
18 #endif  /* _LIBIBVERBS_ALLOCA_H_ */