[Bug 775] New: Define conflict with opencv 2.1.1


Summary: Define conflict with opencv 2.1.1
Product: BFL
Version: trunk
Platform: All
OS/Version: GNU/Linux
Status: NEW
Severity: critical
Priority: P4
Component: core
AssignedTo: bfl [..] ...
ReportedBy: nschmitz [..] ...
CC: bfl [..] ...
Estimated Hours: 0.0


the define DEFAULT in src/pdf/pdf.h collides with an enum in the opencv 2.1.1
(both versions are trunk versions) Therefore I propose to use static const int
instead of defines. This is proposed by Effective C++ and reduces possible

A patch against pdf.h could be

Index: src/pdf/pdf.h
--- src/pdf/pdf.h (Revision 32178)
+++ src/pdf/pdf.h (Arbeitskopie)
@@ -44,10 +44,14 @@
using namespace std;

// Defines for different sampling methods
-#define DEFAULT 0 // Default sampling method, must be valid for every PDF!!
-#define BOXMULLER 1
-#define CHOLESKY 2
-#define RIPLEY 3 // For efficient sampling from discrete/mcpdfs
+static const int DEFAULT = 0;
+static const int BOXMULLER = 1;
+static const int CHOLESKY = 2;
+static const int RIPLEY = 3;

/// Class PDF: Virtual Base class representing Probability Density Functions
template <typename T> class Pdf

Thanks for your work.

Norbert Schmitz