Fixed a memory leak in prefs_account_generate_msgid().
[claws.git] / m4 / gnupg-check-typedef.m4
1 dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME [, COMMENT])
2 dnl Check whether a typedef exists and create a #define $2 if it exists
3 dnl Copyright (C) 2003 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7 dnl
8 AC_DEFUN([GNUPG_CHECK_TYPEDEF],
9   [ AC_MSG_CHECKING(for $1 typedef)
10     AC_CACHE_VAL(gnupg_cv_typedef_$1,
11     [AC_TRY_COMPILE([#include <stdlib.h>
12     #include <sys/types.h>], [
13     #undef $1
14     int a = sizeof($1);
15     ], gnupg_cv_typedef_$1=yes, gnupg_cv_typedef_$1=no )])
16     AC_MSG_RESULT($gnupg_cv_typedef_$1)
17     if test "$gnupg_cv_typedef_$1" = yes; then
18         AC_DEFINE($2, 1, $3)
19     fi
20   ])
21