[Live-devel] Breaking change

Nikolai Vorontsov nikolai.vorontsov at quadrox.be
Mon Mar 11 08:02:05 PDT 2013


Hi Ross & Jeff,
 
first of all in Boost 1.49 I didn't find a Boolean class. May be it's in
a newer version defined.
 
Second, Ross - the issue here is that someone might need to have to
include both Live555 and other library  (boost or libvc) headers to his
_single_ source file. If other library declares it's own Boolean type
(class) then this one will have a name conflict.
 
The exact solution for that problem is namespaces. If you place all your
library names to a separate namespace, then you become independent from
other declarations.
To simplify migration for existing code, you might add "using namespace"
statement and then it should be completely transparent for customers.
The person with clashes might need to add specifies like boost:: or
live555:: before Boolean object declaration to resolve ambiguity.
 
Also, if some of supported compilers doesn't use namespaces (well, may
be some embedded one) - then you might need to use conditional
compilation as you did over 9000 times before ;-)
 
Nikolai

________________________________

From: live-devel-bounces at ns.live555.com
[mailto:live-devel-bounces at ns.live555.com] On Behalf Of Ross Finlayson
Sent: Monday, March 11, 2013 3:22 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] Breaking change



	I am updating live555 from 2012.2.29 to 2013.03.07 and found a
change in Boolean.hh that breaks my build. From reading the changelog, I
think this is recent.
	The line
	    " #define Boolean bool "


No, it's *not* recent; it's almost 9 months old!  From the changelog:

2012.06.12:
- Updated "UsageEnvironment/include/Boolean.hh" to use the 'bool' type
defined for "MSVC++ 8.0, Visual Studio 2005 and higher",
  if that development environment is being used.  Also, fixed a few
places in the code where we were using boolean types
  incorrectly.  (Thanks to Nikolai Vorontsov for these suggestions.)



	Overwrites a class name in boost  (move.cpp)  where there is a
class with the name Boolean


Here is the current contents of "UsageEnvironment/include/Boolean.hh".
Feel free to propose a change that you think works for you (and is not
likely to break for everyone else, for which this existing code works!):


#if defined(__BORLANDC__)  ||  (defined(_MSC_VER) &&  _MSC_VER >= 1400)
// MSVC++ 8.0, Visual Studio 2005 and higher
#define Boolean bool
#define False false
#define True true
#else
typedef unsigned char Boolean;
#ifndef __MSHTML_LIBRARY_DEFINED__
#ifndef False
const Boolean False = 0;
#endif
#ifndef True
const Boolean True = 1;
#endif
#endif
#endif



	 In the past I have had this collide with libavcodec.


Huh?  Why are you compiling "libavcodec" code with our header files?



	So I end up modifying this file every time I upgrade.


If you modifiy the supplied code, you can expect *no* support on this
mailing list!



	Is the problem  a tough one to fix for live555?


As I noted above, the current "Boolean.hh" has been there for almost 9
months.  Noone else has complained in that time; this (IMHO) calls into
question the legitimacy of your complaint.

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/ 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130311/ff745c5e/attachment.html>


More information about the live-devel mailing list