File: protocol_binary.m4

package info (click to toggle)
libmemcached 1.0.8-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,912 kB
  • sloc: cpp: 39,309; ansic: 18,449; sh: 11,864; python: 603; yacc: 437; lex: 195; makefile: 116
file content (30 lines) | stat: -rw-r--r-- 1,168 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
dnl ---------------------------------------------------------------------------
dnl Macro: PROTOCOL_BINARY_TEST
dnl ---------------------------------------------------------------------------

AC_DEFUN([PROTOCOL_BINARY_TEST], [
    AC_LANG_PUSH([C++])
    AC_CACHE_CHECK([for supported struct padding], [ac_cv_supported_struct_padding], [
      AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
          [ #include <inttypes.h>
#include "libmemcached/memcached/protocol_binary.h"
          ], [ protocol_binary_request_set request;
          int a = 1;
          switch (a) {
          case sizeof(request):
          case sizeof(request.bytes):
          break;
          default:
          a = 2;
          }
          ])],
        [ ac_cv_supported_struct_padding=no ],
        [ ac_cv_supported_struct_padding=yes ])
      ])
      AC_LANG_POP
      AS_IF([test "x$ac_cv_supported_struct_padding" = "xno"],[ AC_MSG_ERROR([Unsupported struct padding done by compiler.])])
      ])

dnl ---------------------------------------------------------------------------
dnl End Macro: PROTOCOL_BINARY_TEST
dnl ---------------------------------------------------------------------------