gettimeofday: port recent C++ fix to Emacs
[gnulib.git] / m4 / no-c++.m4
1 # no-c++.m4 serial 1
2 dnl Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 # Support for C source files that cannot be compiled by a C++ compiler.
8 # Set NO_CXX to the C++ compiler flags needed to request C mode instead of
9 # C++ mode.
10 # So far only g++ is supported.
11
12 AC_DEFUN([gt_NO_CXX],
13 [
14   NO_CXX=
15   AC_EGREP_CPP([Is g++], [
16 #if defined __GNUC__ && defined __cplusplus
17   Is g++
18 #endif
19     ],
20     [NO_CXX="-x c"])
21   AC_SUBST([NO_CXX])
22 ])