1## Copyright (c) 2009, 2011  Openismus GmbH  <http://www.openismus.com/>
2##
3## This file is part of glibmm.
4##
5## glibmm is free software: you can redistribute it and/or modify it
6## under the terms of the GNU Lesser General Public License as published
7## by the Free Software Foundation, either version 2.1 of the License,
8## or (at your option) any later version.
9##
10## glibmm is distributed in the hope that it will be useful, but
11## WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13## See the GNU Lesser General Public License for more details.
14##
15## You should have received a copy of the GNU Lesser General Public License
16## along with this library.  If not, see <http://www.gnu.org/licenses/>.
17
18#serial 20120912
19
20## GLIBMM_C_STD_TIME_T_IS_NOT_INT32
21##
22## Test whether std::time_t and gint32 are typedefs of the same builting type.
23## If they aren't then they can be used for method overload.  In that case
24## GLIBMM_HAVE_C_STD_TIME_T_IS_NOT_INT32 is defined to 1.
25##
26AC_DEFUN([GLIBMM_C_STD_TIME_T_IS_NOT_INT32],
27[
28  AC_CACHE_CHECK(
29    [whether std::time_t is not equivalent to gint32, meaning that it can be used for a method overload],
30    [glibmm_cv_c_std_time_t_is_not_int32],
31  [
32    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
33    [[
34      #include <ctime>
35    ]],[[
36      typedef signed int gint32;
37      class Test
38      {
39        void something(gint32 val)
40        {}
41
42        void something(std::time_t val)
43        {}
44      };
45    ]])],
46      [glibmm_cv_c_std_time_t_is_not_int32='yes'],
47      [glibmm_cv_c_std_time_t_is_not_int32='no']
48    )
49  ])
50
51  AS_VAR_IF([glibmm_cv_c_std_time_t_is_not_int32], ['yes'],
52            [AC_DEFINE([GLIBMM_HAVE_C_STD_TIME_T_IS_NOT_INT32], [1],
53                       [Defined when std::time_t is not equivalent to gint32, meaning that it can be used for a method overload])])[]dnl
54])
55