Merge lp:~tangent-org/libmemcached/1.0-build/ Build: jenkins-Libmemcached-187
[m6w6/libmemcached] / m4 / protocol_binary.m4
1 dnl ---------------------------------------------------------------------------
2 dnl Macro: PROTOCOL_BINARY_TEST
3 dnl ---------------------------------------------------------------------------
4
5 AC_DEFUN([PROTOCOL_BINARY_TEST], [
6 AC_LANG_PUSH([C++])
7 AC_CACHE_CHECK([for supported struct padding], [ac_cv_supported_struct_padding], [
8 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
9 [ #include <inttypes.h>
10 #include "libmemcached/memcached/protocol_binary.h"
11 ], [ protocol_binary_request_set request;
12 int a = 1;
13 switch (a) {
14 case sizeof(request):
15 case sizeof(request.bytes):
16 break;
17 default:
18 a = 2;
19 }
20 ])],
21 [ ac_cv_supported_struct_padding=no ],
22 [ ac_cv_supported_struct_padding=yes ])
23 ])
24 AC_LANG_POP
25 AS_IF([test "x$ac_cv_supported_struct_padding" = "xno"],[ AC_MSG_ERROR([Unsupported struct padding done by compiler.])])
26 ])
27
28 dnl ---------------------------------------------------------------------------
29 dnl End Macro: PROTOCOL_BINARY_TEST
30 dnl ---------------------------------------------------------------------------