Uses Reference if compiler has no port

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@48 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
tslettebo 2002-09-16 01:58:52 +00:00
parent 0b9d261d9b
commit ad7e89ad22
31 changed files with 509 additions and 470 deletions

View file

@ -1,25 +1,24 @@
////////////////////////////////////// ///////////////////////////////////////
//Generated header: AbstractFactory.h // Generated header: AbstractFactory.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
///////////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/AbstractFactory.h" # include "Reference/AbstractFactory.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/AbstractFactory.h" # include "Reference/AbstractFactory.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/AbstractFactory.h"
# elif (__BORLANDC__)
# include "./Borland/AbstractFactory.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/AbstractFactory.h" # include "Reference/AbstractFactory.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/AbstractFactory.h" # include "Borland/AbstractFactory.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/AbstractFactory.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/AbstractFactory.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/AbstractFactory.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
////////////////////////////////// ///////////////////////////////////
//Generated header: AssocVector.h // Generated header: AssocVector.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
///////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/AssocVector.h" # include "Reference/AssocVector.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/AssocVector.h" # include "Reference/AssocVector.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/AssocVector.h"
# elif (__BORLANDC__)
# include "./Borland/AssocVector.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/AssocVector.h" # include "Reference/AssocVector.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/AssocVector.h" # include "Borland/AssocVector.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/AssocVector.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/AssocVector.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/AssocVector.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
//////////////////////////////// /////////////////////////////////
//Generated header: EmptyType.h // Generated header: EmptyType.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
/////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/EmptyType.h" # include "Reference/EmptyType.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/EmptyType.h" # include "Reference/EmptyType.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/EmptyType.h"
# elif (__BORLANDC__)
# include "./Borland/EmptyType.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/EmptyType.h" # include "Reference/EmptyType.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/EmptyType.h" # include "Borland/EmptyType.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/EmptyType.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/EmptyType.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/EmptyType.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
////////////////////////////// ///////////////////////////////
//Generated header: Factory.h // Generated header: Factory.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
///////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/Factory.h" # include "Reference/Factory.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/Factory.h" # include "Reference/Factory.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/Factory.h"
# elif (__BORLANDC__)
# include "./Borland/Factory.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/Factory.h" # include "Reference/Factory.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/Factory.h" # include "Borland/Factory.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/Factory.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/Factory.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/Factory.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
////////////////////////////// ///////////////////////////////
//Generated header: Functor.h // Generated header: Functor.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
///////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/Functor.h" # include "Reference/Functor.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/Functor.h" # include "Reference/Functor.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/Functor.h"
# elif (__BORLANDC__)
# include "./Borland/Functor.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/Functor.h" # include "Reference/Functor.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/Functor.h" # include "Borland/Functor.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/Functor.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/Functor.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/Functor.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
////////////////////////////////////////// ///////////////////////////////////////////
//Generated header: HierarchyGenerators.h // Generated header: HierarchyGenerators.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
///////////////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/HierarchyGenerators.h" # include "Reference/HierarchyGenerators.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/HierarchyGenerators.h" # include "Reference/HierarchyGenerators.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/HierarchyGenerators.h"
# elif (__BORLANDC__)
# include "./Borland/HierarchyGenerators.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/HierarchyGenerators.h" # include "Reference/HierarchyGenerators.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/HierarchyGenerators.h" # include "Borland/HierarchyGenerators.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/HierarchyGenerators.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/HierarchyGenerators.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/HierarchyGenerators.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -454,8 +454,12 @@ namespace Loki
static no check(...); static no check(...);
public: public:
// VC7 fail NPS_HierarchyGenerators.h if this one is enum #if (_MSC_VER >= 1300)
static const unsigned int type_id = sizeof(check( Type2Type<T>() )); // VC7 fail NPS_HierarchyGenerators.h if this one is enum
static const unsigned int type_id = sizeof(check( Type2Type<T>() ));
#else
enum { type_id = sizeof(check( Type2Type<T>() )) };
#endif
enum { value = type_id != sizeof(no) }; enum { value = type_id != sizeof(no) };

View file

@ -1,25 +1,24 @@
/////////////////////////////////// ////////////////////////////////////
//Generated header: MultiMethods.h // Generated header: MultiMethods.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
////////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/MultiMethods.h" # include "Reference/MultiMethods.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/MultiMethods.h" # include "Reference/MultiMethods.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/MultiMethods.h"
# elif (__BORLANDC__)
# include "./Borland/MultiMethods.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/MultiMethods.h" # include "Reference/MultiMethods.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/MultiMethods.h" # include "Borland/MultiMethods.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/MultiMethods.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/MultiMethods.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/MultiMethods.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
/////////////////////////////// ////////////////////////////////
//Generated header: NullType.h // Generated header: NullType.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/NullType.h" # include "Reference/NullType.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/NullType.h" # include "Reference/NullType.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/NullType.h"
# elif (__BORLANDC__)
# include "./Borland/NullType.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/NullType.h" # include "Reference/NullType.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/NullType.h" # include "Borland/NullType.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/NullType.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/NullType.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/NullType.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -80,13 +80,13 @@ namespace Loki
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
template <class T, class H> template <class T, class H>
typename H::Rebind<T>::Result& Field(H& obj) typename H::template Rebind<T>::Result& Field(H& obj)
{ {
return obj; return obj;
} }
template <class T, class H> template <class T, class H>
const typename H::Rebind<T>::Result& Field(const H& obj) const typename H::template Rebind<T>::Result& Field(const H& obj)
{ {
return obj; return obj;
} }
@ -126,7 +126,7 @@ namespace Loki
struct FieldHelper<H, 0> struct FieldHelper<H, 0>
{ {
typedef typename H::TList::Head ElementType; typedef typename H::TList::Head ElementType;
typedef typename H::Rebind<ElementType>::Result UnitType; typedef typename H::template Rebind<ElementType>::Result UnitType;
enum enum
{ {
@ -156,7 +156,7 @@ namespace Loki
struct FieldHelper struct FieldHelper
{ {
typedef typename TL::TypeAt<typename H::TList, i>::Result ElementType; typedef typename TL::TypeAt<typename H::TList, i>::Result ElementType;
typedef typename H::Rebind<ElementType>::Result UnitType; typedef typename H::template Rebind<ElementType>::Result UnitType;
enum enum
{ {
@ -249,6 +249,7 @@ namespace Loki
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Change log: // Change log:
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!! // June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
// September 16, 2002: Fixed dependent template, using "::template" syntax. T.S.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#endif // HIERARCHYGENERATORS_INC_ #endif // HIERARCHYGENERATORS_INC_

View file

@ -105,7 +105,7 @@ namespace Loki
{ {
typedef Private::ConversionHelper<T, U> H; typedef Private::ConversionHelper<T, U> H;
#ifndef __MWERKS__ #ifndef __MWERKS__
enum { exists = sizeof(typename H::Small) == sizeof(H::Test(H::MakeT())) }; enum { exists = sizeof(typename H::Small) == sizeof((H::Test(H::MakeT()))) };
#else #else
enum { exists = false }; enum { exists = false };
#endif #endif
@ -139,6 +139,22 @@ namespace Loki
}; };
} // namespace Loki } // namespace Loki
////////////////////////////////////////////////////////////////////////////////
// class template SuperSubclass
// Invocation: SuperSubclass<B, D>::value where B and D are types.
// Returns true if B is a public base of D, or if B and D are aliases of the
// same type.
//
// Caveat: might not work if T and U are in a private inheritance hierarchy.
////////////////////////////////////////////////////////////////////////////////
template <class T, class U>
struct SuperSubclass
{
enum { value = (::Loki::Conversion<const volatile U*, const volatile T*>::exists &&
!::Loki::Conversion<const volatile T*, const volatile void*>::sameType) };
};
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// macro SUPERSUBCLASS // macro SUPERSUBCLASS
// Invocation: SUPERSUBCLASS(B, D) where B and D are types. // Invocation: SUPERSUBCLASS(B, D) where B and D are types.
@ -146,6 +162,7 @@ namespace Loki
// same type. // same type.
// //
// Caveat: might not work if T and U are in a private inheritance hierarchy. // Caveat: might not work if T and U are in a private inheritance hierarchy.
// Deprecated: Use SuperSubclass class template instead.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#define SUPERSUBCLASS(T, U) \ #define SUPERSUBCLASS(T, U) \
@ -153,11 +170,28 @@ namespace Loki
!::Loki::Conversion<const volatile T*, const volatile void*>::sameType) !::Loki::Conversion<const volatile T*, const volatile void*>::sameType)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// macro SUPERSUBCLASS // class template SuperSubclassStrict
// Invocation: SuperSubclassStrict<B, D>::value where B and D are types.
// Returns true if B is a public base of D.
//
// Caveat: might not work if T and U are in a private inheritance hierarchy.
////////////////////////////////////////////////////////////////////////////////
template<class T,class U>
struct SuperSubclassStrict
{
enum { value = (::Loki::Conversion<const volatile U*, const volatile T*>::exists &&
!::Loki::Conversion<const volatile T*, const volatile void*>::sameType &&
!::Loki::Conversion<const volatile T*, const volatile U*>::sameType) };
};
////////////////////////////////////////////////////////////////////////////////
// macro SUPERSUBCLASS_STRICT
// Invocation: SUPERSUBCLASS(B, D) where B and D are types. // Invocation: SUPERSUBCLASS(B, D) where B and D are types.
// Returns true if B is a public base of D. // Returns true if B is a public base of D.
// //
// Caveat: might not work if T and U are in a private inheritance hierarchy. // Caveat: might not work if T and U are in a private inheritance hierarchy.
// Deprecated: Use SuperSubclassStrict class template instead.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#define SUPERSUBCLASS_STRICT(T, U) \ #define SUPERSUBCLASS_STRICT(T, U) \
@ -172,6 +206,12 @@ namespace Loki
// (credit due to Brad Town) // (credit due to Brad Town)
// November 23, 2001: (well it's 12:01 am) fixed bug in SUPERSUBCLASS - added // November 23, 2001: (well it's 12:01 am) fixed bug in SUPERSUBCLASS - added
// the volatile qualifier to be 100% politically correct // the volatile qualifier to be 100% politically correct
// September 16, 2002: Changed "const volatile" to "const volatile *", to enable
// conversion to succeed. Done earlier by MKH.
// Added SuperSubclass and SuperSubclassStrict templates. The corresponding
// macros are deprecated.
// Added extra parenthesis in sizeof in Conversion, to disambiguate function
// call from function declaration. T.S.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#endif // TYPEMANIP_INC_ #endif // TYPEMANIP_INC_

View file

@ -70,6 +70,21 @@ namespace Loki
int, long int) StdSignedInts; int, long int) StdSignedInts;
typedef TYPELIST_3(bool, char, wchar_t) StdOtherInts; typedef TYPELIST_3(bool, char, wchar_t) StdOtherInts;
typedef TYPELIST_3(float, double, long double) StdFloats; typedef TYPELIST_3(float, double, long double) StdFloats;
template <class U> struct AddReference
{
typedef U & Result;
};
template <class U> struct AddReference<U &>
{
typedef U & Result;
};
template <> struct AddReference<void>
{
typedef NullType Result;
};
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -216,8 +231,7 @@ namespace Loki
enum { isFundamental = isStdFundamental || isArith || isFloat }; enum { isFundamental = isStdFundamental || isArith || isFloat };
typedef typename Select<isStdArith || isPointer || isMemberPointer, typedef typename Select<isStdArith || isPointer || isMemberPointer,
T, ReferredType&>::Result T, typename Private::AddReference<T>::Result>::Result ParameterType;
ParameterType;
enum { isConst = UnConst<T>::isConst }; enum { isConst = UnConst<T>::isConst };
typedef typename UnConst<T>::Result NonConstType; typedef typename UnConst<T>::Result NonConstType;
@ -231,6 +245,8 @@ namespace Loki
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Change log: // Change log:
// June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!! // June 20, 2001: ported by Nick Thurn to gcc 2.95.3. Kudos, Nick!!!
// September 16, 2002: ParameterType fixed, as TypeTraits<void> made
// ParameterType give error about reference to void. T.S.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#endif // TYPETRAITS_INC_ #endif // TYPETRAITS_INC_

View file

@ -664,10 +664,10 @@ namespace Loki
template <class TList> struct Reverse; template <class TList> struct Reverse;
template <class T> template <>
struct Reverse< TYPELIST_1(T) > struct Reverse<NullType>
{ {
typedef TYPELIST_1(T) Result; typedef NullType Result;
}; };
template <class Head, class Tail> template <class Head, class Tail>
@ -700,7 +700,7 @@ namespace Loki
typedef typename MostDerived<Tail, T>::Result Candidate; typedef typename MostDerived<Tail, T>::Result Candidate;
public: public:
typedef typename Select< typedef typename Select<
SUPERSUBCLASS(Candidate, Head), SuperSubclass<Candidate,Head>::value,
Head, Candidate>::Result Result; Head, Candidate>::Result Result;
}; };
@ -748,7 +748,10 @@ namespace Loki
// Kevin Cline who sent the first actual fix) // Kevin Cline who sent the first actual fix)
// May 13, 2002: TYPELIST_46 called TYPELIST_45 with only 44 parameters. // May 13, 2002: TYPELIST_46 called TYPELIST_45 with only 44 parameters.
// Credit due to Robert Minsk // Credit due to Robert Minsk
// September 16, 2002: Changed MostDerived to use the new SuperSubclass template
// (rather than the SUPERSUBCLASS macro).
// Minor fix in Reverse, adding support for empty lists, like all the other
// algorithms. T.S.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#endif // TYPELIST_INC_ #endif // TYPELIST_INC_

View file

@ -1,25 +1,24 @@
////////////////////////////////// ///////////////////////////////////
//Generated header: Singleton.cpp // Generated header: Singleton.cpp
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
///////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/Singleton.cpp" # include "Reference/Singleton.cpp"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/Singleton.cpp" # include "Reference/Singleton.cpp"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/Singleton.cpp"
# elif (__BORLANDC__)
# include "./Borland/Singleton.cpp"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/Singleton.cpp" # include "Reference/Singleton.cpp"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/Singleton.cpp" # include "Borland/Singleton.cpp"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/Singleton.cpp"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/Singleton.cpp"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/Singleton.cpp"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
//////////////////////////////// /////////////////////////////////
//Generated header: Singleton.h // Generated header: Singleton.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
/////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/Singleton.h" # include "Reference/Singleton.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/Singleton.h" # include "Reference/Singleton.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/Singleton.h"
# elif (__BORLANDC__)
# include "./Borland/Singleton.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/Singleton.h" # include "Reference/Singleton.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/Singleton.h" # include "Borland/Singleton.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/Singleton.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/Singleton.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/Singleton.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
///////////////////////////////// //////////////////////////////////
//Generated header: SmallObj.cpp // Generated header: SmallObj.cpp
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
//////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/SmallObj.cpp" # include "Reference/SmallObj.cpp"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/SmallObj.cpp" # include "Reference/SmallObj.cpp"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/SmallObj.cpp"
# elif (__BORLANDC__)
# include "./Borland/SmallObj.cpp"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/SmallObj.cpp" # include "Reference/SmallObj.cpp"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/SmallObj.cpp" # include "Borland/SmallObj.cpp"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/SmallObj.cpp"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/SmallObj.cpp"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/SmallObj.cpp"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
/////////////////////////////// ////////////////////////////////
//Generated header: SmallObj.h // Generated header: SmallObj.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/SmallObj.h" # include "Reference/SmallObj.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/SmallObj.h" # include "Reference/SmallObj.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/SmallObj.h"
# elif (__BORLANDC__)
# include "./Borland/SmallObj.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/SmallObj.h" # include "Reference/SmallObj.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/SmallObj.h" # include "Borland/SmallObj.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/SmallObj.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/SmallObj.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/SmallObj.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
/////////////////////////////// ////////////////////////////////
//Generated header: SmartPtr.h // Generated header: SmartPtr.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/SmartPtr.h" # include "Reference/SmartPtr.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/SmartPtr.h" # include "Reference/SmartPtr.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/SmartPtr.h"
# elif (__BORLANDC__)
# include "./Borland/SmartPtr.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/SmartPtr.h" # include "Reference/SmartPtr.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/SmartPtr.h" # include "Borland/SmartPtr.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/SmartPtr.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/SmartPtr.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/SmartPtr.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
////////////////////////////// ///////////////////////////////
//Generated header: Threads.h // Generated header: Threads.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
///////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/Threads.h" # include "Reference/Threads.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/Threads.h" # include "Reference/Threads.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/Threads.h"
# elif (__BORLANDC__)
# include "./Borland/Threads.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/Threads.h" # include "Reference/Threads.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/Threads.h" # include "Borland/Threads.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/Threads.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/Threads.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/Threads.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

33
Tuple.h
View file

@ -1,25 +1,24 @@
//////////////////////////// /////////////////////////////
//Generated header: Tuple.h // Generated header: Tuple.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
/////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/Tuple.h" # include "Reference/Tuple.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/Tuple.h" # include "Reference/Tuple.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/Tuple.h"
# elif (__BORLANDC__)
# include "./Borland/Tuple.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/Tuple.h" # include "Reference/Tuple.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/Tuple.h" # include "Borland/Tuple.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/Tuple.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/Tuple.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/Tuple.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
/////////////////////////////// ////////////////////////////////
//Generated header: TypeInfo.h // Generated header: TypeInfo.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/TypeInfo.h" # include "Reference/TypeInfo.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/TypeInfo.h" # include "Reference/TypeInfo.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/TypeInfo.h"
# elif (__BORLANDC__)
# include "./Borland/TypeInfo.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/TypeInfo.h" # include "Reference/TypeInfo.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/TypeInfo.h" # include "Borland/TypeInfo.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/TypeInfo.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/TypeInfo.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/TypeInfo.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
//////////////////////////////// /////////////////////////////////
//Generated header: TypeManip.h // Generated header: TypeManip.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
/////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/TypeManip.h" # include "Reference/TypeManip.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/TypeManip.h" # include "Reference/TypeManip.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/TypeManip.h"
# elif (__BORLANDC__)
# include "./Borland/TypeManip.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/TypeManip.h" # include "Reference/TypeManip.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/TypeManip.h" # include "Borland/TypeManip.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/TypeManip.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/TypeManip.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/TypeManip.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
///////////////////////////////// //////////////////////////////////
//Generated header: TypeTraits.h // Generated header: TypeTraits.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
//////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/TypeTraits.h" # include "Reference/TypeTraits.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/TypeTraits.h" # include "Reference/TypeTraits.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/TypeTraits.h"
# elif (__BORLANDC__)
# include "./Borland/TypeTraits.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/TypeTraits.h" # include "Reference/TypeTraits.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/TypeTraits.h" # include "Borland/TypeTraits.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/TypeTraits.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/TypeTraits.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/TypeTraits.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
/////////////////////////////// ////////////////////////////////
//Generated header: Typelist.h // Generated header: Typelist.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/Typelist.h" # include "Reference/Typelist.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/Typelist.h" # include "Reference/Typelist.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/Typelist.h"
# elif (__BORLANDC__)
# include "./Borland/Typelist.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/Typelist.h" # include "Reference/Typelist.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/Typelist.h" # include "Borland/Typelist.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/Typelist.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/Typelist.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/Typelist.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
////////////////////////////// ///////////////////////////////
//Generated header: Visitor.h // Generated header: Visitor.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
///////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/Visitor.h" # include "Reference/Visitor.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/Visitor.h" # include "Reference/Visitor.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/Visitor.h"
# elif (__BORLANDC__)
# include "./Borland/Visitor.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/Visitor.h" # include "Reference/Visitor.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/Visitor.h" # include "Borland/Visitor.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/Visitor.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/Visitor.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/Visitor.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,25 +1,24 @@
/////////////////////////////////// ////////////////////////////////////
//Generated header: static_check.h // Generated header: static_check.h
//Forwards to the appropriate code // Forwards to the appropriate code
// that works on the detected compiler // that works on the detected compiler
//Generated on Sun Sep 08 18:42:42 2002 // Generated on Sun Sep 15 15:31:17 2002
////////////////////////////////////
#ifdef LOKI_USE_REFERENCE #ifdef LOKI_USE_REFERENCE
# include "./Reference/static_check.h" # include "Reference/static_check.h"
#else #else
# if (_MSC_VER >= 1300) # if (__INTEL_COMPILER)
# include "./MSVC/1300/static_check.h" # include "Reference/static_check.h"
# elif (_MSC_VER >= 1200)
# include "./MSVC/1200/static_check.h"
# elif (__BORLANDC__)
# include "./Borland/static_check.h"
# elif (__MWERKS__) # elif (__MWERKS__)
# include "./Reference/static_check.h" # include "Reference/static_check.h"
# elif ( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) ) # elif (__BORLANDC__ >= 0x560)
# include "./Reference/static_check.h" # include "Borland/static_check.h"
# elif (_MSC_VER >= 1300)
# include "MSVC/1300/static_check.h"
# elif (_MSC_VER >= 1200)
# include "MSVC/1200/static_check.h"
# else # else
//Define LOKI_USE_REFERENCE and get back to us on the results # include "Reference/static_check.h"
# error Compiler not tested with Loki, #define LOKI_USE_REFERENCE
# endif # endif
#endif #endif

View file

@ -1,9 +1,18 @@
/////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
//Generates forwarding headers using the information // Generates forwarding headers using the information
//in the header.lst & vendor.lst files // in the header.lst & vendor.lst files
// //
//To create a header list from an existing directory of headers // To create a header list from an existing directory of headers
//dir *.h /b > headers.lst // dir *.h /b > headers.lst
//
// Copyright Shannon Barber 2002.
//
// Permission to use, copy, modify, distribute and sell this software for any
// purpose is hereby granted without fee, provided that the above copyright
// notice appear in all copies and that both that copyright notice and this
// permission notice appear in supporting documentation. It is provided "as is"
// without express or implied warranty.
////////////////////////////////////////////////////////////////////////////////
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
@ -11,6 +20,7 @@
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include <ctime> #include <ctime>
using namespace std; using namespace std;
struct Compiler struct Compiler
@ -23,62 +33,49 @@ struct Compiler
string subdir; string subdir;
}; };
typedef vector<Compiler> cv_t;
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
if(argc < 2) if(argc != 3)
{ {
cout <<"Usage: <Header List> [Version/Vendor List]"<<endl; cout <<"Usage: <Header List> <Version/Vendor List>"<<endl;
return -1; return -1;
} }
typedef vector<Compiler> cv_type;
cv_t vendors; cv_type vendors;
char buf[1024]; char buf[1024];
string check; string check;
string subdir; string subdir;
fstream vendor_file; fstream vendor_file;
if(argc >= 3)
vendor_file.open(argv[2], ios::in);
if(!vendor_file.is_open())
{ {
vendor_file.open(argv[2], ios::in); cout << "Unable to open vendor file: " << argv[2] << endl;
if(!vendor_file.is_open()) return -2;
}
else
{
vendors.reserve(10);
while(!vendor_file.eof())
{ {
cout << "Unable to open vendor file: " << argv[2] << endl; vendor_file.getline(buf, 1024, '\n');
return -2; check = buf;
} vendor_file.getline(buf, 1024, '\n');
else subdir = buf;
{ vendor_file.getline(buf, 1024, '\n');
vendors.reserve(10); if(!(check.empty() || subdir.empty()))
while(!vendor_file.eof()) vendors.push_back(Compiler(check, subdir));
else
{ {
check = ""; cout << "Error parsing vendors, check:" << check << "\tsubdir:" << subdir << endl;
subdir = "";
vendor_file.getline(buf, 1024, '\n');
check = buf;
vendor_file.getline(buf, 1024, '\n');
subdir = buf;
vendor_file.getline(buf, 1024, '\n');
if(!(check.empty() || subdir.empty()))
vendors.push_back(Compiler(check, subdir));
else
{
cout << "Error parsing vendors, check:" << check << "\tsubdir:" << subdir << endl;
}
} }
} }
} }
else //if(vendors.empty())
{
cout << "No vendor file provided, using defaults\n";
vendors.reserve(10);
vendors.push_back(Compiler("(_MSC_VER >= 1300)", "MSVC\\1300"));
vendors.push_back(Compiler("(__BORLANDC__)", "Borland"));
vendors.push_back(Compiler("( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 95)) )", "Reference"));
}
fstream header_list(argv[1]); fstream header_list(argv[1]);
string header; string header;
stringstream ss;
if(!header_list.is_open()) if(!header_list.is_open())
{ {
@ -96,49 +93,47 @@ int main(int argc, char* argv[])
} }
else else
{ {
ss.str(""); string start(string("// Generated header: ")+header+'\n');
ss << "//Generated header: " << header << endl; string line(start.size(),'/');
size_t n = ss.str().size();
for(size_t i=0; i<n; ++i) header_file << line << '\n';
header_file << "/"; header_file << start;
header_file << endl; header_file << "// Forwards to the appropriate code\n";
header_file << ss.str();
header_file << "//Forwards to the appropriate code\n";
header_file << "// that works on the detected compiler\n"; header_file << "// that works on the detected compiler\n";
time_t rawtime; time(&rawtime); time_t rawtime;
header_file << "//Generated on " << ctime(&rawtime); time(&rawtime);
header_file << endl << endl; header_file << "// Generated on " << ctime(&rawtime);
header_file << line << "\n\n";
cv_t::iterator it=vendors.begin(), itEnd = vendors.end();
cv_type::iterator it=vendors.begin(), itEnd = vendors.end();
header_file << "#ifdef LOKI_USE_REFERENCE\n"; header_file << "#ifdef LOKI_USE_REFERENCE\n";
header_file << "#\tinclude \"./Reference/" << header << "\"\n"; header_file << "#\tinclude \"Reference/" << header << "\"\n";
//header_file << "#\tinclude \".\\Reference\\" << header << "\"\n";
header_file << "#else\n"; header_file << "#else\n";
header_file << "#\tif " << it->version_test << endl; header_file << "#\tif " << it->version_test << endl;
//header_file << "#\t\tinclude \".\\" << it->subdir; header_file << "#\t\tinclude \"" << it->subdir << "/" << header << "\"\n";
header_file << "#\t\tinclude \"./" << it->subdir;
//header_file << "\\" << header << "\"\n";
header_file << "/" << header << "\"\n";
++it; ++it;
for(; it!=itEnd; ++it) for(; it!=itEnd; ++it)
{ {
header_file << "#\telif " << it->version_test << endl; header_file << "#\telif " << it->version_test << endl;
//header_file << "#\t\tinclude \".\\" << it->subdir; header_file << "#\t\tinclude \"" << it->subdir;
header_file << "#\t\tinclude \"./" << it->subdir;
//header_file << "\\" << header << "\"\n";
header_file << "/" << header << "\"\n"; header_file << "/" << header << "\"\n";
} }
header_file << "#\telse\n"; header_file << "#\telse\n";
header_file << "\t\t//Define LOKI_USE_REFERENCE and get back to us on the results\n"; header_file << "#\t\tinclude \"Reference/" << header << "\"\n";
header_file << "#\t\terror Compiler not tested with Loki, #define LOKI_USE_REFERENCE\n";
header_file << "#\tendif\n"; header_file << "#\tendif\n";
header_file << "#endif\n"; header_file << "#endif\n";
} }
} }
#ifdef _MSC_VER
system("PAUSE");
#endif
return 0; return 0;
} }
////////////////////////////////////////////////////////////////////////////////
// Change log:
// September 16, 2002: Changed it to only test for compilers where ports exist,
// else use the Reference version. It used to give an error if used on a
// compiler that wasn't tested for. Also removed "./".
// It still needs to test for Intel and Metrowerks, as these define _MSC_VER,
// too. T.S.
////////////////////////////////////////////////////////////////////////////////

View file

@ -1,14 +1,14 @@
(__INTEL_COMPILER)
Reference
(__MWERKS__)
Reference
(__BORLANDC__ >= 0x560)
Borland
(_MSC_VER >= 1300) (_MSC_VER >= 1300)
MSVC/1300 MSVC/1300
(_MSC_VER >= 1200) (_MSC_VER >= 1200)
MSVC/1200 MSVC/1200
(__BORLANDC__)
Borland
(__MWERKS__)
Reference
( (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)) )
Reference

View file

@ -16,6 +16,7 @@
#define ABSTRACTFACTORYTEST_H #define ABSTRACTFACTORYTEST_H
#include <memory> #include <memory>
#include <typeinfo>
#include <loki/AbstractFactory.h> #include <loki/AbstractFactory.h>
#include "UnitTest.h" #include "UnitTest.h"

View file

@ -18,13 +18,13 @@
#include "TypelistTest.h" #include "TypelistTest.h"
#include "TypeManipTest.h" #include "TypeManipTest.h"
#include "TypeTraitsTest.h" #include "TypeTraitsTest.h"
#include "SmallObjectTest.h" //#include "SmallObjectTest.h"
#include "SingletonTest.h" //#include "SingletonTest.h"
#include "SmartPtrTest.h" //#include "SmartPtrTest.h"
#include "FactoryTest.h" //#include "FactoryTest.h"
#include "AbstractFactoryTest.h" #include "AbstractFactoryTest.h"
#include "AssocVectorTest.h" //#include "AssocVectorTest.h"
#include "FunctorTest.h" //#include "FunctorTest.h"
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// LokiTest // LokiTest
@ -49,13 +49,13 @@ private:
tests.add(typelistTest); tests.add(typelistTest);
tests.add(typeManipTest); tests.add(typeManipTest);
tests.add(typeTraitsTest); tests.add(typeTraitsTest);
tests.add(smallObjectTest); // tests.add(smallObjectTest);
tests.add(singletonTest); // tests.add(singletonTest);
tests.add(smartPtrTest); // tests.add(smartPtrTest);
tests.add(factoryTest); // tests.add(factoryTest);
tests.add(abstractFactoryTest); tests.add(abstractFactoryTest);
tests.add(assocVectorTest); // tests.add(assocVectorTest);
tests.add(functorTest); // tests.add(functorTest);
} }
private: private:
@ -65,13 +65,13 @@ private:
TypelistTest typelistTest; TypelistTest typelistTest;
TypeManipTest typeManipTest; TypeManipTest typeManipTest;
TypeTraitsTest typeTraitsTest; TypeTraitsTest typeTraitsTest;
SmallObjectTest smallObjectTest; // SmallObjectTest smallObjectTest;
SingletonTest singletonTest; // SingletonTest singletonTest;
SmartPtrTest smartPtrTest; // SmartPtrTest smartPtrTest;
FactoryTest factoryTest; // FactoryTest factoryTest;
AbstractFactoryTest abstractFactoryTest; AbstractFactoryTest abstractFactoryTest;
AssocVectorTest assocVectorTest; // AssocVectorTest assocVectorTest;
FunctorTest functorTest; // FunctorTest functorTest;
}; };
#endif #endif

View file

@ -13,7 +13,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#ifdef __INTEL_COMPILER #ifdef __INTEL_COMPILER
# pragma warning(disable: 111 193 304 383 444 981 1418) # pragma warning(disable: 111 193 304 383 444 488 981 1418)
#endif #endif
#include "LokiTest.h" #include "LokiTest.h"