From 8fb273bb0e96fe1bb1bfe2e9f29bbb18ef6da976 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Mon, 18 May 2015 13:13:58 +0200 Subject: [PATCH 1/3] [3870] protect OPTIONAL against a #define in system headers --- src/bin/dhcp4/dhcp4_srv.h | 4 ++++ src/bin/dhcp6/dhcp6_srv.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/bin/dhcp4/dhcp4_srv.h b/src/bin/dhcp4/dhcp4_srv.h index 6a05a245a7..835fe65b3f 100644 --- a/src/bin/dhcp4/dhcp4_srv.h +++ b/src/bin/dhcp4/dhcp4_srv.h @@ -33,6 +33,10 @@ #include #include +#ifdef OPTIONAL +#undef OPTIONAL +#endif + namespace isc { namespace dhcp { diff --git a/src/bin/dhcp6/dhcp6_srv.h b/src/bin/dhcp6/dhcp6_srv.h index 0099b7ea86..7571f2b976 100644 --- a/src/bin/dhcp6/dhcp6_srv.h +++ b/src/bin/dhcp6/dhcp6_srv.h @@ -32,6 +32,10 @@ #include #include +#ifdef OPTIONAL +#undef OPTIONAL +#endif + namespace isc { namespace dhcp { From a2c740a8cafdbb2ba13b2f37cfa25b9582b9ccc8 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Tue, 23 Jun 2015 19:42:03 +0200 Subject: [PATCH 2/3] [3870] Added a comment to explain the guard --- src/bin/dhcp4/dhcp4_srv.h | 4 ++++ src/bin/dhcp6/dhcp6_srv.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/bin/dhcp4/dhcp4_srv.h b/src/bin/dhcp4/dhcp4_srv.h index 835fe65b3f..8683f19a62 100644 --- a/src/bin/dhcp4/dhcp4_srv.h +++ b/src/bin/dhcp4/dhcp4_srv.h @@ -33,6 +33,10 @@ #include #include +// Undefine the macro OPTIONAL which is defined in some operating +// systems but conflicts with a member of the RequirementLevel enum in +// the server class. + #ifdef OPTIONAL #undef OPTIONAL #endif diff --git a/src/bin/dhcp6/dhcp6_srv.h b/src/bin/dhcp6/dhcp6_srv.h index 7571f2b976..63ad9ae22e 100644 --- a/src/bin/dhcp6/dhcp6_srv.h +++ b/src/bin/dhcp6/dhcp6_srv.h @@ -32,6 +32,10 @@ #include #include +// Undefine the macro OPTIONAL which is defined in some operating +// systems but conflicts with a member of the RequirementLevel enum in +// the server class. + #ifdef OPTIONAL #undef OPTIONAL #endif From 60c6e347ef3e1d411d3ef6ff9c52fbf961500124 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Tue, 23 Jun 2015 19:42:31 +0200 Subject: [PATCH 3/3] [3870] Added the OPTIONAL macro guard for d2 --- src/bin/d2/d_cfg_mgr.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bin/d2/d_cfg_mgr.h b/src/bin/d2/d_cfg_mgr.h index c479f7eb5d..13e77a5e8e 100644 --- a/src/bin/d2/d_cfg_mgr.h +++ b/src/bin/d2/d_cfg_mgr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2013, 2015 Internet Systems Consortium, Inc. ("ISC") // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above @@ -22,6 +22,13 @@ #include #include +// Undefine the macro OPTIONAL which is defined in some operating +// systems but conflicts with class constant is the context base class. + +#ifdef OPTIONAL +#undef OPTIONAL +#endif + namespace isc { namespace d2 {