Commit 02bc417e authored by Eddie Kohler's avatar Eddie Kohler

Changes to compile cleanly with LLVM clang.

parent ac4c25e1
......@@ -70,6 +70,9 @@
/* Define if the C++ compiler understands constexpr. */
#undef HAVE_CXX_CONSTEXPR
/* Define if the C++ compiler understands #pragma interface. */
#undef HAVE_CXX_PRAGMA_INTERFACE
/* Define if the C++ compiler understands static_assert. */
#undef HAVE_CXX_STATIC_ASSERT
......
......@@ -3130,12 +3130,14 @@ _ACEOF
ac_user_cc=; test -n "$CC" && ac_user_cc=y
ac_user_kernel_cc=; test -n "$KERNEL_CC" && ac_user_kernel_cc=y
ac_user_cxx=; test -n "$CXX" && ac_user_cxx=y
ac_user_build_cxx=; test -n "$BUILD_CXX" && ac_user_build_cxx=y
ac_user_kernel_cxx=; test -n "$KERNEL_CXX" && ac_user_kernel_cxx=y
ac_user_depcflags=; test -n "$DEPCFLAGS" && ac_user_depcflags=y
ac_user_cc=${CC+y}
ac_user_cflags=${CFLAGS+y}
ac_user_kernel_cc=${KERNEL_CC+y}
ac_user_cxx=${CXX+y}
ac_user_cxxflags=${CXXFLAGS+y}
ac_user_build_cxx=${BUILD_CXX+y}
ac_user_kernel_cxx=${KENREL_CXX+y}
ac_user_depcflags=${DEPCFLAGS+y}
ac_compile_with_warnings=y
conf_auxdir='$(top_srcdir)'
......@@ -4662,10 +4664,10 @@ done
ac_base_cc="$CC"
test -z "$ac_user_cc" -a -n "$GCC" -a -n "$ac_compile_with_warnings" && \
CC="$CC -W -Wall"
test -z "$ac_user_cflags" -a -n "$GCC" -a -n "$ac_compile_with_warnings" && \
CFLAGS="$CFLAGS -W -Wall"
test -z "$ac_user_cc" -a -n "$GCC" -a -n "$ac_compile_with_warnings" -a -z "$ac_user_depcflags" && \
test -z "$ac_user_cflags" -a -n "$GCC" -a -n "$ac_compile_with_warnings" -a -z "$ac_user_depcflags" && \
DEPCFLAGS="-MD -MP"
......@@ -5160,22 +5162,6 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test -n "$GXX"; then
GXX_VERSION=`$CXX --version | head -n 1 | sed 's/^[^0-9]*\([0-9.]*\).*/\1/'`
GXX_MAJOR=`echo $GXX_VERSION | sed 's/\..*//'`
GXX_MINOR=`echo $GXX_VERSION | sed 's/^[^.]*\.\([^.]*\).*/\1/'`
if test $GXX_MAJOR -lt 2 -o \( $GXX_MAJOR -eq 2 -a $GXX_MINOR -le 7 \); then
as_fn_error $? "
=========================================
Your GNU C++ compiler ($CXX) is too old!
Either download a newer compiler, or tell me to use a different compiler
by setting the 'CXX' environment variable and rerunning me.
=========================================" "$LINENO" 5
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <new> works" >&5
......@@ -5321,13 +5307,49 @@ $as_echo "#define HAVE_CXX_STATIC_ASSERT 1" >>confdefs.h
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler understands #pragma interface" >&5
$as_echo_n "checking whether the C++ compiler understands #pragma interface... " >&6; }
if ${ac_cv_cxx_pragma_interface+:} false; then :
$as_echo_n "(cached) " >&6
else
save_cxxflags="$CXXFLAGS"; CXXFLAGS="$CXXFLAGS -Werror -Wall -W"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#pragma interface "foo.c"
#pragma implementation "foo.c"
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_cxx_pragma_interface=yes
else
ac_cv_cxx_pragma_interface=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CXXFLAGS="$save_cxxflags"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_pragma_interface" >&5
$as_echo "$ac_cv_cxx_pragma_interface" >&6; }
if test "$ac_cv_cxx_pragma_interface" = yes; then
$as_echo "#define HAVE_CXX_PRAGMA_INTERFACE 1" >>confdefs.h
fi
CXX_WARNINGS=
test -z "$ac_user_cxx" -a -n "$GXX" -a -n "$ac_compile_with_warnings" && \
CXX_WARNINGS='-W -Wall'
test -z "$ac_user_cxxflags" -a -n "$GXX" -a -n "$ac_compile_with_warnings" && \
CXX_WARNINGS="-W -Wall"
ac_base_cxx="$CXX"
test -z "$ac_user_cxx" -a -n "$GXX" -a -n "$ac_compile_with_warnings" && \
test -z "$ac_user_cxxflags" -a -n "$GXX" -a -n "$ac_compile_with_warnings" && \
CXX="$CXX $CXX_WARNINGS $VTABLE_THUNKS"
CXXFLAGS_NDEBUG=`echo "$CXXFLAGS" | sed 's/-g//'`
......@@ -7339,7 +7361,7 @@ else
ac_cv_endian=0
cat > conftest.$ac_ext <<EOF
#line 7342 "configure"
#line 7364 "configure"
#include "confdefs.h"
#include <$endian_hdr>
#ifdef __BYTE_ORDER
......
......@@ -38,7 +38,7 @@ namespace IPSummaryDump {
static bool ip_extract(PacketDesc& d, const FieldWriter *f)
{
int network_length = d.network_length();
uint32_t network_length = d.network_length();
switch (f->user_data) {
// IP header properties
......@@ -91,7 +91,7 @@ static bool ip_extract(PacketDesc& d, const FieldWriter *f)
d.v = d.iph->ip_p;
return true;
case T_IP_OPT:
if (!d.iph || (d.iph->ip_hl > 5 && network_length < (int)(d.iph->ip_hl << 2)))
if (!d.iph || (d.iph->ip_hl > 5 && network_length < (uint32_t)(d.iph->ip_hl << 2)))
return field_missing(d, MISSING_IP, (d.iph ? d.iph->ip_hl << 2 : 20));
if (d.iph->ip_hl <= 5)
d.vptr[0] = d.vptr[1] = 0;
......
......@@ -49,7 +49,7 @@ StoreTimestamp::configure(Vector<String> &conf, ErrorHandler *errh)
Packet *
StoreTimestamp::simple_action(Packet *p)
{
int offset = (_offset < 0 ? p->length() : _offset);
int offset = (_offset < 0 ? (int) p->length() : _offset);
int delta = offset + 8 - p->length();
if (WritablePacket *q = p->put(delta < 0 ? 0 : delta)) {
memcpy(q->data() + offset, &q->timestamp_anno(), 8);
......
......@@ -159,7 +159,7 @@ ToIPFlowDumps::Flow::output_binary(StringAccum &sa)
pi++;
} else {
int len = (ni == _nnote - 1 ? _note_text.length() : _note[ni+1].pos) - _note[ni].pos;
int len = (ni == _nnote - 1 ? (uint32_t) _note_text.length() : _note[ni+1].pos) - _note[ni].pos;
int record_len = (4 + len + 2);
buf.u[0] = ntohl(record_len | 0x80000000U);
buf.c[4] = '#';
......@@ -294,7 +294,7 @@ ToIPFlowDumps::Flow::output(ErrorHandler *errh)
pi++;
} else {
int len = (ni == _nnote - 1 ? _note_text.length() : _note[ni+1].pos) - _note[ni].pos;
int len = (ni == _nnote - 1 ? (uint32_t) _note_text.length() : _note[ni+1].pos) - _note[ni].pos;
sa << '#';
sa.append(_note_text.data() + _note[ni].pos, len);
sa << '\n';
......
......@@ -8,7 +8,7 @@ CLICK_DECLS
class IPMapper;
class IPRewriterPattern;
struct IPRewriterInput {
class IPRewriterInput { public:
enum {
i_drop, i_nochange, i_keep, i_pattern, i_mapper
};
......
......@@ -68,7 +68,7 @@ RatedSource::configure(Vector<String> &conf, ErrorHandler *errh)
if (bandwidth > 0 && burst < 2 * datasize)
burst = 2 * datasize;
_tb.assign(rate, burst);
_limit = (limit >= 0 ? limit : NO_LIMIT);
_limit = (limit >= 0 ? unsigned(limit) : NO_LIMIT);
_active = active;
_stop = stop;
......@@ -206,7 +206,7 @@ RatedSource::change_param(const String &s, Element *e, void *vparam,
int limit;
if (!IntArg().parse(s, limit))
return errh->error("syntax error");
rs->_limit = (limit < 0 ? NO_LIMIT : limit);
rs->_limit = (limit >= 0 ? unsigned(limit) : NO_LIMIT);
break;
}
......
......@@ -473,7 +473,7 @@ class Script : public Element { public:
Timer _timer;
int *_cur_steps;
struct Expander : public VariableExpander {
class Expander : public VariableExpander { public:
Script *script;
ErrorHandler *errh;
int expand(const String &var, String &expansion, int vartype, int depth) const;
......
......@@ -35,7 +35,7 @@ CLICK_DECLS
const char ControlSocket::protocol_version[] = "1.3";
struct ControlSocketErrorHandler : public ErrorHandler { public:
class ControlSocketErrorHandler : public ErrorHandler { public:
ControlSocketErrorHandler()
: _error_code(ControlSocket::CSERR_OK), _nwarnings(0) {
......
......@@ -26,7 +26,7 @@ class ErrorHandler;
function doesn't modify Args internals. Also, ArgContext objects are smaller
and quicker to construct than Args objects.
*/
struct ArgContext {
class ArgContext { public:
/** @brief Construct an argument context.
* @param errh optional error handler */
......@@ -176,10 +176,9 @@ struct ArgContext {
parse succeeds. (This doesn't matter in the context of Args, but can matter
to users who call a parse function directly.)
*/
struct Args : public ArgContext {
private:
class Args : public ArgContext {
struct Slot;
public:
/** @brief Construct an argument parser.
......@@ -879,7 +878,7 @@ void args_base_read_all_with(Args *args, const char *keyword, int flags,
/** @endcond never */
struct NumArg {
class NumArg { public:
enum {
status_ok = 0,
status_inval = EINVAL,
......@@ -906,7 +905,7 @@ struct NumArg {
Integer overflow is treated as an error.
@sa SaturatingIntArg, BoundedIntArg */
struct IntArg : public NumArg {
class IntArg : public NumArg { public:
typedef uint32_t limb_type;
......@@ -970,7 +969,7 @@ struct IntArg : public NumArg {
not an error; instead, the closest representable value is returned.
@sa IntArg */
struct SaturatingIntArg : public IntArg {
class SaturatingIntArg : public IntArg { public:
SaturatingIntArg(int b = 0)
: IntArg(b) {
}
......@@ -988,7 +987,7 @@ struct SaturatingIntArg : public IntArg {
less than @a min or greater than @a max are treated as errors.
@sa IntArg */
struct BoundedIntArg : public IntArg {
class BoundedIntArg : public IntArg { public:
BoundedIntArg(int min_value, int max_value, int b = 0)
: IntArg(b), min_value(min_value), max_value(max_value) {
}
......@@ -1030,7 +1029,7 @@ template<> struct DefaultArg<long long> : public IntArg {};
/** @class FixedPointArg
@brief Parser class for fixed-point numbers with @a b bits of fraction. */
struct FixedPointArg : public NumArg {
class FixedPointArg : public NumArg { public:
explicit FixedPointArg(int b, int exponent = 0)
: fraction_bits(b), exponent_delta(exponent) {
}
......@@ -1053,7 +1052,7 @@ FixedPointArg::parse_saturating(const String &str, uint32_t &result, const ArgCo
/** @class DecimalFixedPointArg
@brief Parser class for fixed-point numbers with @a d decimal digits of fraction. */
struct DecimalFixedPointArg : public NumArg {
class DecimalFixedPointArg : public NumArg { public:
DecimalFixedPointArg(int d, int exponent = 0)
: fraction_digits(d), exponent_delta(exponent) {
}
......@@ -1080,7 +1079,7 @@ DecimalFixedPointArg::parse_saturating(const String &str, uint32_t &result, cons
#if HAVE_FLOAT_TYPES
/** @class DoubleArg
@brief Parser class for double-precision floating point numbers. */
struct DoubleArg : public NumArg {
class DoubleArg : public NumArg { public:
DoubleArg() {
}
bool parse(const String &str, double &result, const ArgContext &args = blank_args);
......@@ -1093,7 +1092,7 @@ template<> struct DefaultArg<double> : public DoubleArg {};
/** @class BoolArg
@brief Parser class for booleans. */
struct BoolArg {
class BoolArg { public:
static bool parse(const String &str, bool &result, const ArgContext &args = blank_args);
static String unparse(bool x) {
return String(x);
......@@ -1103,7 +1102,7 @@ struct BoolArg {
template<> struct DefaultArg<bool> : public BoolArg {};
struct UnitArg {
class UnitArg { public:
explicit UnitArg(const char *unit_def, const char *prefix_chars_def)
: units_(reinterpret_cast<const unsigned char *>(unit_def)),
prefix_chars_(reinterpret_cast<const unsigned char *>(prefix_chars_def)) {
......@@ -1120,7 +1119,7 @@ struct UnitArg {
@brief Parser class for bandwidth specifications.
Handles suffixes such as "Gbps", "k", etc. */
struct BandwidthArg : public NumArg {
class BandwidthArg : public NumArg { public:
bool parse(const String &str, uint32_t &result, const ArgContext & = blank_args);
static String unparse(uint32_t x);
int status;
......@@ -1130,7 +1129,7 @@ struct BandwidthArg : public NumArg {
#if !CLICK_TOOL
/** @class AnnoArg
@brief Parser class for annotation specifications. */
struct AnnoArg {
class AnnoArg { public:
AnnoArg(int s)
: size(s) {
}
......@@ -1146,7 +1145,7 @@ struct AnnoArg {
The @a d argument is the number of digits of fraction to parse.
For example, to parse milliseconds, use SecondsArg(3). */
struct SecondsArg : public NumArg {
class SecondsArg : public NumArg { public:
SecondsArg(int d = 0)
: fraction_digits(d) {
}
......@@ -1162,7 +1161,7 @@ struct SecondsArg : public NumArg {
/** @class AnyArg
@brief Parser class that accepts any argument. */
struct AnyArg {
class AnyArg { public:
static bool parse(const String &, const ArgContext & = blank_args) {
return true;
}
......@@ -1181,7 +1180,7 @@ bool cp_string(const String &str, String *result, String *rest);
/** @class StringArg
@brief Parser class for possibly-quoted strings. */
struct StringArg {
class StringArg { public:
static bool parse(const String &str, String &result, const ArgContext & = blank_args) {
return cp_string(str, &result, 0);
}
......@@ -1194,7 +1193,7 @@ bool cp_keyword(const String &str, String *result, String *rest);
/** @class KeywordArg
@brief Parser class for keywords. */
struct KeywordArg {
class KeywordArg { public:
static bool parse(const String &str, String &result, const ArgContext & = blank_args) {
return cp_keyword(str, &result, 0);
}
......@@ -1205,7 +1204,7 @@ bool cp_word(const String &str, String *result, String *rest);
/** @class KeywordArg
@brief Parser class for words. */
struct WordArg {
class WordArg { public:
static bool parse(const String &str, String &result, const ArgContext & = blank_args) {
return cp_word(str, &result, 0);
}
......@@ -1215,7 +1214,7 @@ struct WordArg {
#if CLICK_USERLEVEL || CLICK_TOOL
/** @class FilenameArg
@brief Parser class for filenames. */
struct FilenameArg {
class FilenameArg { public:
static bool parse(const String &str, String &result, const ArgContext &args = blank_args);
};
#endif
......@@ -1224,7 +1223,7 @@ struct FilenameArg {
#if !CLICK_TOOL
/** @class ElementArg
@brief Parser class for elements. */
struct ElementArg {
class ElementArg { public:
static bool parse(const String &str, Element *&result, const ArgContext &args);
};
......@@ -1232,7 +1231,7 @@ template<> struct DefaultArg<Element *> : public ElementArg {};
/** @class ElementCastArg
@brief Parser class for elements of type @a t. */
struct ElementCastArg {
class ElementCastArg { public:
ElementCastArg(const char *t)
: type(t) {
}
......
......@@ -43,7 +43,7 @@ class HashMap_Arena { public:
void *hard_alloc();
friend class Link; // shut up, compiler
friend struct Link; // shut up, compiler
};
......
......@@ -11,7 +11,7 @@ class Router;
class Master;
class ErrorHandler;
class Lexer;
class ArchiveElement;
struct ArchiveElement;
void click_static_initialize();
void click_static_cleanup();
......@@ -28,7 +28,7 @@ CLICK_ENDDECLS
#elif CLICK_TOOL
CLICK_DECLS
class ErrorHandler;
class ArchiveElement;
struct ArchiveElement;
void click_static_initialize();
......
......@@ -194,7 +194,7 @@ extern const ArgContext blank_args;
.read_mp_with("SRC", EtherAddressArg(), ethh.ether_shost)
...
@endcode */
struct EtherAddressArg {
class EtherAddressArg { public:
static bool parse(const String &str, EtherAddress &value, const ArgContext &args = blank_args);
static bool parse(const String &str, unsigned char *value, const ArgContext &args = blank_args) {
return parse(str, *reinterpret_cast<EtherAddress *>(value), args);
......
......@@ -299,7 +299,7 @@ typedef struct device net_device;
// COMPILE-TIME ASSERTION CHECKING
#if !defined(__cplusplus) || !HAVE_CXX_STATIC_ASSERT
# define static_assert(x, ...) switch (x) case 0: case !!(x):
# define static_assert(x, ...) switch ((int) (x)) case 0: case !!((int) (x)):
#endif
......
......@@ -312,7 +312,7 @@ struct IP6AddressArg {
/** @class IP6PrefixArg
@brief Parser class for IPv6 address prefixes. */
struct IP6PrefixArg {
class IP6PrefixArg { public:
IP6PrefixArg(bool allow_bare_address_ = false)
: allow_bare_address(allow_bare_address_) {
}
......
......@@ -361,7 +361,7 @@ IPAddress::s() const
/** @class IPAddressArg
@brief Parser class for IPv4 addresses. */
struct IPAddressArg {
class IPAddressArg { public:
static const char *basic_parse(const char *begin, const char *end,
unsigned char value[4], int &nbytes);
static bool parse(const String &str, IPAddress &result,
......@@ -376,7 +376,7 @@ struct IPAddressArg {
/** @class IPPrefixArg
@brief Parser class for IPv4 prefixes. */
struct IPPrefixArg {
class IPPrefixArg { public:
IPPrefixArg(bool allow_bare_address_ = false)
: allow_bare_address(allow_bare_address_) {
}
......@@ -402,7 +402,7 @@ template<> struct has_trivial_copy<IPAddress> : public true_type {};
@brief Parser class for TCP/UDP ports.
The constructor argument is the relevant IP protocol. */
struct IPPortArg {
class IPPortArg { public:
IPPortArg(int p)
: ip_p(p) {
assert(ip_p > 0 && ip_p < 256);
......
......@@ -207,7 +207,7 @@ class Lexer { public:
friend class Compound;
friend class TunnelEnd;
friend class FileState;
friend struct FileState;
};
......
......@@ -3,7 +3,7 @@
#define CLICK_NOTIFIER_HH
#include <click/task.hh>
#include <click/atomic.hh>
#if __GNUC__
#if HAVE_CXX_PRAGMA_INTERFACE
# pragma interface "click/notifier.hh"
#endif
CLICK_DECLS
......
......@@ -7,6 +7,7 @@ class Packet;
class Storage { public:
typedef uint32_t index_type;
typedef int32_t signed_index_type;
Storage() : _head(0), _tail(0) { }
......@@ -45,8 +46,8 @@ class Storage { public:
inline int
Storage::size(index_type head, index_type tail) const
{
int x = tail - head;
return (x >= 0 ? x : _capacity + x + 1);
index_type x = tail - head;
return (signed_index_type(x) >= 0 ? x : _capacity + x + 1);
}
inline int
......
......@@ -711,7 +711,7 @@ class String { public:
static String make_claim(char *, int, int); // claim memory
friend class rep_t;
friend struct rep_t;
friend class StringAccum;
};
......
......@@ -1446,7 +1446,7 @@ bool cp_time(const String &str, Timestamp *result, bool allow_negative);
/** @class TimestampArg
@brief Parser class for timestamps. */
struct TimestampArg {
class TimestampArg { public:
TimestampArg(bool is_signed = false)
: is_signed(is_signed) {
}
......
......@@ -637,7 +637,8 @@ click_qsort(void *base, size_t n, size_t size,
size_t s = (pa - a < pb - pa ? pa - a : pb - pa);
if (s)
cq_swapfunc(a, pb - s, s, swaptype);
s = ((size_t) (pd - pc) < pn - pd - size ? pd - pc : pn - pd - size);
size_t pd_minus_pc = pd - pc;
s = (pd_minus_pc < pn - pd - size ? pd_minus_pc : pn - pd - size);
if (s)
cq_swapfunc(pb, pn - s, s, swaptype);
......
......@@ -19,7 +19,7 @@
*/
#include <click/config.h>
#if __GNUC__
#if HAVE_CXX_PRAGMA_INTERFACE
# pragma implementation "click/notifier.hh"
#endif
#include <click/notifier.hh>
......
......@@ -13,12 +13,14 @@ dnl If so, we don't screw with their choices later.
dnl
AC_DEFUN([CLICK_INIT], [
ac_user_cc=; test -n "$CC" && ac_user_cc=y
ac_user_kernel_cc=; test -n "$KERNEL_CC" && ac_user_kernel_cc=y
ac_user_cxx=; test -n "$CXX" && ac_user_cxx=y
ac_user_build_cxx=; test -n "$BUILD_CXX" && ac_user_build_cxx=y
ac_user_kernel_cxx=; test -n "$KERNEL_CXX" && ac_user_kernel_cxx=y
ac_user_depcflags=; test -n "$DEPCFLAGS" && ac_user_depcflags=y
ac_user_cc=${CC+y}
ac_user_cflags=${CFLAGS+y}
ac_user_kernel_cc=${KERNEL_CC+y}
ac_user_cxx=${CXX+y}
ac_user_cxxflags=${CXXFLAGS+y}
ac_user_build_cxx=${BUILD_CXX+y}
ac_user_kernel_cxx=${KENREL_CXX+y}
ac_user_depcflags=${DEPCFLAGS+y}
ac_compile_with_warnings=y
conf_auxdir=$1
......@@ -41,10 +43,10 @@ AC_DEFUN([CLICK_PROG_CC], [
AC_REQUIRE([AC_PROG_CC])
ac_base_cc="$CC"
test -z "$ac_user_cc" -a -n "$GCC" -a -n "$ac_compile_with_warnings" && \
CC="$CC -W -Wall"
test -z "$ac_user_cflags" -a -n "$GCC" -a -n "$ac_compile_with_warnings" && \
CFLAGS="$CFLAGS -W -Wall"
test -z "$ac_user_cc" -a -n "$GCC" -a -n "$ac_compile_with_warnings" -a -z "$ac_user_depcflags" && \
test -z "$ac_user_cflags" -a -n "$GCC" -a -n "$ac_compile_with_warnings" -a -z "$ac_user_depcflags" && \
DEPCFLAGS="-MD -MP"
AC_SUBST(DEPCFLAGS)
......@@ -82,22 +84,6 @@ and Linux header files are GCC-specific.)
fi
AC_LANG_CPLUSPLUS
if test -n "$GXX"; then
changequote(<<,>>)GXX_VERSION=`$CXX --version | head -n 1 | sed 's/^[^0-9]*\([0-9.]*\).*/\1/'`
GXX_MAJOR=`echo $GXX_VERSION | sed 's/\..*//'`
GXX_MINOR=`echo $GXX_VERSION | sed 's/^[^.]*\.\([^.]*\).*/\1/'`changequote([,])
if test $GXX_MAJOR -lt 2 -o \( $GXX_MAJOR -eq 2 -a $GXX_MINOR -le 7 \); then
AC_MSG_ERROR([
=========================================
Your GNU C++ compiler ($CXX) is too old!
Either download a newer compiler, or tell me to use a different compiler
by setting the 'CXX' environment variable and rerunning me.
=========================================])
fi
fi
dnl check for <new> and <new.h>
......@@ -142,14 +128,24 @@ by setting the 'CXX' environment variable and rerunning me.
AC_DEFINE([HAVE_CXX_STATIC_ASSERT], [1], [Define if the C++ compiler understands static_assert.])
fi
AC_CACHE_CHECK([[whether the C++ compiler understands #pragma interface]], [ac_cv_cxx_pragma_interface], [
save_cxxflags="$CXXFLAGS"; CXXFLAGS="$CXXFLAGS -Werror -Wall -W"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#pragma interface "foo.c"
#pragma implementation "foo.c"]], [[]])], [ac_cv_cxx_pragma_interface=yes], [ac_cv_cxx_pragma_interface=no])
CXXFLAGS="$save_cxxflags"
])
if test "$ac_cv_cxx_pragma_interface" = yes; then
AC_DEFINE([HAVE_CXX_PRAGMA_INTERFACE], [1], [Define if the C++ compiler understands #pragma interface.])
fi
dnl define correct warning options
CXX_WARNINGS=
test -z "$ac_user_cxx" -a -n "$GXX" -a -n "$ac_compile_with_warnings" && \
CXX_WARNINGS='-W -Wall'
test -z "$ac_user_cxxflags" -a -n "$GXX" -a -n "$ac_compile_with_warnings" && \