Commit 3d0e1261 authored by Andrea Valassi's avatar Andrea Valassi Committed by cdelort
Browse files

Final? patch for COOL #ifdefs? (CORALCOOL-2943)

git-svn-id: https://svnweb.cern.ch/trac/lcgcool/changeset/20131 4525493e-7705-40b1-a816-d608a930855b
parent baa8fece
......@@ -2,81 +2,30 @@
#define COOLKERNEL_VERSIONINFO_H 1
// Explicitly disable COOL400 extensions (do not allow -D to enable them)
#undef COOL400 // COOL 2.x or COOL 3.x
#undef COOL400 // COOL 3.x
#undef COOL400CPP11ENUM // API changes for c++11 enum class (bug #103344)
// These switches are now hardcoded in all branches of the code (bug #92204).
#define COOL300 1 // COOL 3.x
//#undef COOL300 // COOL 2.x
// This switch is no longer needed in trunk (CORALCOOL-1111, CORALCOOL-2943)
//#define COOL300 1 // COOL 3.0 or higher (COOL 2.x is no longer supported!)
// These switches are now hardcoded in all branches of the code (bug #92204).
#define COOL290 1 // COOL 2.9.x or higher (COOL 2.8.x is no longer supported)
// This switch is no longer needed in trunk (CORALCOOL-1111, CORALCOOL-2943)
//#define COOL290 1 // COOL 2.9 or higher (COOL 2.8 is no longer supported!)
// This switch is now hardcoded in all supported branches (CORALCOOL-2808),
// i.e. COOL 2.9.x or higher (COOL 2.8.x is no longer supported).
// NEW! c++11 is used in COOL internals even if COOL_HAS_CPP11 is not defined!
// TODO: eventually, remove COOL_HAS_CPP11 completely (CORALCOOL-2809)
#define COOL_HAS_CPP11 1
// This switch is no longer needed in trunk (CORALCOOL-2808, CORALCOOL-2809)
//#define COOL_HAS_CPP11 1 // COOL code uses c++11
// COOL_VERSIONINFO_RELEASE is #defined in API as of COOL 2.8.4 (sr #111706)
// COOL_VERSIONINFO_RELEASE_x are #defined as of COOL 2.8.15
// Note that the former is defined within quotes, the latter are not!
#ifdef COOL300
#define COOL_VERSIONINFO_RELEASE_MAJOR 3
#define COOL_VERSIONINFO_RELEASE_MINOR 1
#define COOL_VERSIONINFO_RELEASE_PATCH 5
#define COOL_VERSIONINFO_RELEASE "3.1.5"
#else
#define COOL_VERSIONINFO_RELEASE_MAJOR 2
#define COOL_VERSIONINFO_RELEASE_MINOR 9
#define COOL_VERSIONINFO_RELEASE_PATCH 7
#define COOL_VERSIONINFO_RELEASE "2.9.7"
#endif
//---------------------------------------------------------------------------
// Enable COOL 2.9.x API extensions (COOL 2.9.x or COOL 3.x releases)
// Disable COOL 2.9.x API extensions (COOL 2.8.x releases)
//---------------------------------------------------------------------------
#ifdef COOL290
#define COOL290CO 1 // API fixes for Coverity (bugs #95363 and #95823)
#define COOL290EX 1 // API fixes in inlined Exception method (bug #68061)
#define COOL290VP 1 // API extension for vector payload (task #10335)
#else
#error("ERROR: COOL 2.8.x is no longer supported - no path to this statement!")
#endif
//---------------------------------------------------------------------------
// Enable COOL 3.x API changes (COOL 3.x releases)
// Disable COOL 3.x API changes (COOL 2.x releases)
//---------------------------------------------------------------------------
#ifdef COOL300
#define COOL300CPP11 1 // KEPT BUT NO LONGER NEEDED CORALCOOL-2943
#define COOL300TS 1 // KEPT BUT NO LONGER NEEDED CORALCOOL-2943
#define COOL300DP 1 // KEPT BUT NO LONGER NEEDED CORALCOOL-2943
#else
#undef COOL300CPP11 // Do undef (do not leave the option to -D this explicitly)
#undef COOL300TS // Do undef (do not leave the option to -D this explicitly)
#undef COOL300DP // Do undef (do not leave the option to -D this explicitly)
#endif
// Sanity check: does this compiler support c++11? (see CORALCOOL-2808)
#ifdef COOL300CPP11
#if ( ! defined(__GXX_EXPERIMENTAL_CXX0X__) ) && (__cplusplus < 201103L )
#error("ERROR: COOL >= 3.0.0 but this compiler does not support c++11")
#endif
#endif
// Declare obsolete API calls as deprecated
// See http://stackoverflow.com/questions/295120/c-mark-as-deprecated
#ifdef COOL290
#if defined(__clang__) || defined(__GNUC__)
#define COOL_DEPRECATED(func) func __attribute__ ((deprecated))
#else
#error "ERROR: You need to implement COOL_DEPRECATED for this compiler"
#endif
#else
#error("ERROR: COOL 2.8.x is no longer supported - no path to this statement!")
#endif
// Drop support for TimingReport as of COOL 2.8.15 (task #31638)
#undef COOL_ENABLE_TIMING_REPORT
......
// First of all, enable or disable the COOL CPP11
#include "CoolKernel/VersionInfo.h"
// Include files
#ifdef COOL_HAS_CPP11
#include <cstdint> // For int64_t
#endif
#include <cstdlib> // For getenv on gcc43
#include <iostream>
#include "CoolKernel/Record.h"
......@@ -101,7 +96,6 @@ public:
std::cout << "DATA: " << rec << std::endl;
}
#ifdef COOL_HAS_CPP11
// Quick test for int64_t vs cool::Int64 (CORALCOOL-2734)
std::cout << std::endl << "Record[A_Int64] as Int64: "
<< rec["A_Int64"].data<cool::Int64>() << std::endl;
......@@ -117,8 +111,6 @@ public:
std::cout << "Exception caught while trying to retrieve "
<< "Record[A_Int64] as int64_t: " << e.what() << std::endl;
}
#endif
}
catch ( std::exception& e ) {
......
......@@ -3,7 +3,6 @@
// First of all, set/unset COOL400 macros
#include "CoolKernel/VersionInfo.h"
//#undef COOL400CPP11ENUM
// Port to ROOT6 (bug #102630) - remove Reflex dependency
#include "RVersion.h"
......@@ -14,10 +13,6 @@
#error("ERROR: COOL300 requires CPP11 but ROOT5 does not support c++11")
#endif
// Disable deprecation warnings (bug #103338) in PyCool on ROOT6 (ROOT-5870)
#undef COOL_DEPRECATED
#define COOL_DEPRECATED(func) func
// Workaround to avoid "_mingw.h: No such file or directory" warning from
// boost/config/platform/win32.hpp (and possiblyavoid any related problems)
#ifdef _WIN32
......
// First of all, enable or disable the COOL400 API extensions (bug #92204)
// First of all, enable or disable the COOL400 API extensions
#include "CoolKernel/VersionInfo.h"
// Include files
......@@ -156,7 +156,6 @@ public:
// Debug CORALCOOL-2764 on MacOSX
void test_shared_from_this()
{
#ifdef COOL_HAS_CPP11
// Base class
class Base {
public:
......@@ -204,12 +203,10 @@ public:
spB1.reset();
CPPUNIT_ASSERT_EQUAL_MESSAGE( "CountB1 = 0", 0l, spB1.use_count() );
}
#endif
}
void test_shared_from_this_deleter()
{
#ifdef COOL_HAS_CPP11
// Base class
class Base {
public:
......@@ -263,12 +260,10 @@ public:
spB1.reset();
CPPUNIT_ASSERT_EQUAL_MESSAGE( "CountB1 = 0", 0l, spB1.use_count() );
}
#endif
}
void test_shared_from_this_deleter2()
{
#ifdef COOL_HAS_CPP11
// Base class
class Base {
public:
......@@ -330,7 +325,6 @@ public:
spB1.reset();
CPPUNIT_ASSERT_EQUAL_MESSAGE( "CountB1 = 0", 0l, spB1.use_count() );
}
#endif
}
void test_shared_from_this_cool()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment