Add LLONG_MAX defs, fix some warnings
authorScott Cantor <cantor.2@osu.edu>
Thu, 13 Jul 2006 22:01:27 +0000 (22:01 +0000)
committerScott Cantor <cantor.2@osu.edu>
Thu, 13 Jul 2006 22:01:27 +0000 (22:01 +0000)
saml/internal.h
saml/saml1/core/impl/AssertionsImpl.cpp
saml/saml2/core/impl/Assertions20Impl.cpp
saml/saml2/core/impl/Protocols20Impl.cpp
saml/saml2/metadata/impl/MetadataImpl.cpp

index aa0b8ce..7caa141 100644 (file)
 #include "base.h"
 #include "SAMLConfig.h"
 
+#include <limits.h>
+
+// 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 {
index 2299d13..8f24e5b 100644 (file)
@@ -34,6 +34,7 @@
 #include <xmltooling/util/XMLHelper.h>
 
 #include <ctime>
+#include <limits.h>
 #include <xercesc/util/XMLUniDefs.hpp>
 
 using namespace opensaml::saml1;
index b4ca59a..4a5ac94 100644 (file)
@@ -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());
index c471d59..c136be2 100644 (file)
@@ -77,7 +77,7 @@ namespace opensaml {
             }
                 
             ExtensionsImpl(const ExtensionsImpl& src)
-                    : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractElementProxy(src) {
+                    : AbstractXMLObject(src), AbstractElementProxy(src), AbstractDOMCachingXMLObject(src) {
                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
                     if (*i) {
                         getXMLObjects().push_back((*i)->clone());
index e853b65..f3f5eff 100644 (file)
@@ -249,7 +249,7 @@ namespace opensaml {
             }
                 
             ExtensionsImpl(const ExtensionsImpl& src)
-                    : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractElementProxy(src) {
+                    : AbstractXMLObject(src), AbstractElementProxy(src), AbstractDOMCachingXMLObject(src) {
                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
                     if (*i) {
                         getXMLObjects().push_back((*i)->clone());