From: Scott Cantor Date: Thu, 13 Jul 2006 22:01:27 +0000 (+0000) Subject: Add LLONG_MAX defs, fix some warnings X-Git-Tag: 2.0-alpha1~223 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-opensaml.git;a=commitdiff_plain;h=23a6a678afa4e8ade343416279d3768d640d0d85 Add LLONG_MAX defs, fix some warnings --- diff --git a/saml/internal.h b/saml/internal.h index aa0b8ce..7caa141 100644 --- a/saml/internal.h +++ b/saml/internal.h @@ -39,6 +39,37 @@ #include "base.h" #include "SAMLConfig.h" +#include + +// C99 defines LLONG_MIN, LLONG_MAX and ULLONG_MAX, but this part of +// C99 is not yet included into the C++ standard. +// GCC defines LONG_LONG_MIN, LONG_LONG_MAX and ULONG_LONG_MAX. +// Some compilers (such as Comeau C++ up to and including version 4.3.3) +// define nothing. In this last case we make a reasonable guess. +#ifndef LLONG_MIN +#if defined(LONG_LONG_MIN) +#define LLONG_MIN LONG_LONG_MIN +#elif SIZEOF_LONG_LONG == 8 +#define LLONG_MIN 0x8000000000000000LL +#endif +#endif + +#ifndef LLONG_MAX +#if defined(LONG_LONG_MAX) +#define LLONG_MAX LONG_LONG_MAX +#elif SIZEOF_LONG_LONG == 8 +#define LLONG_MAX 0x7fffffffffffffffLL +#endif +#endif + +#ifndef ULLONG_MAX +#if defined(ULONG_LONG_MAX) +#define ULLONG_MAX ULONG_LONG_MAX +#elif SIZEOF_UNSIGNED_LONG_LONG == 8 +#define ULLONG_MAX 0xffffffffffffffffULL +#endif +#endif + #define SAML_LOGCAT "OpenSAML" namespace opensaml { diff --git a/saml/saml1/core/impl/AssertionsImpl.cpp b/saml/saml1/core/impl/AssertionsImpl.cpp index 2299d13..8f24e5b 100644 --- a/saml/saml1/core/impl/AssertionsImpl.cpp +++ b/saml/saml1/core/impl/AssertionsImpl.cpp @@ -34,6 +34,7 @@ #include #include +#include #include using namespace opensaml::saml1; diff --git a/saml/saml2/core/impl/Assertions20Impl.cpp b/saml/saml2/core/impl/Assertions20Impl.cpp index b4ca59a..4a5ac94 100644 --- a/saml/saml2/core/impl/Assertions20Impl.cpp +++ b/saml/saml2/core/impl/Assertions20Impl.cpp @@ -530,7 +530,7 @@ namespace opensaml { } KeyInfoConfirmationDataTypeImpl(const KeyInfoConfirmationDataTypeImpl& src) - : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractAttributeExtensibleXMLObject(src) { + : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) { init(); setNotBefore(src.getNotBefore()); setNotOnOrAfter(src.getNotOnOrAfter()); diff --git a/saml/saml2/core/impl/Protocols20Impl.cpp b/saml/saml2/core/impl/Protocols20Impl.cpp index c471d59..c136be2 100644 --- a/saml/saml2/core/impl/Protocols20Impl.cpp +++ b/saml/saml2/core/impl/Protocols20Impl.cpp @@ -77,7 +77,7 @@ namespace opensaml { } ExtensionsImpl(const ExtensionsImpl& src) - : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractElementProxy(src) { + : AbstractXMLObject(src), AbstractElementProxy(src), AbstractDOMCachingXMLObject(src) { for (list::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) { if (*i) { getXMLObjects().push_back((*i)->clone()); diff --git a/saml/saml2/metadata/impl/MetadataImpl.cpp b/saml/saml2/metadata/impl/MetadataImpl.cpp index e853b65..f3f5eff 100644 --- a/saml/saml2/metadata/impl/MetadataImpl.cpp +++ b/saml/saml2/metadata/impl/MetadataImpl.cpp @@ -249,7 +249,7 @@ namespace opensaml { } ExtensionsImpl(const ExtensionsImpl& src) - : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractElementProxy(src) { + : AbstractXMLObject(src), AbstractElementProxy(src), AbstractDOMCachingXMLObject(src) { for (list::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) { if (*i) { getXMLObjects().push_back((*i)->clone());