[mythtv-commits] Ticket #1885: Mac OS X compile error with abs(long long)

MythTV mythtv at cvs.mythtv.org
Wed May 31 00:16:21 UTC 2006


#1885: Mac OS X compile error with abs(long long)
--------------------+-------------------------------------------------------
 Reporter:  nigel   |        Owner:  nigel   
     Type:  defect  |       Status:  assigned
 Priority:  minor   |    Milestone:  0.20    
Component:  mythtv  |      Version:  head    
 Severity:  medium  |   Resolution:          
--------------------+-------------------------------------------------------
Comment (by nigel):

 This illustrates the problem:
 {{{
 #include <cstdlib>
 use namespace std;

 int main()
 {
     long long test = -1;

     if ( abs(test) > 1 )
         exit(-1)

     exit(0);
 }
 }}}
 On any GCC 3.3 machine (My Mac, Sparc Solaris, ''et c.'') it gives the
 error when the namespace line is there, but not if it is commented out. I
 am guessing that only after 3.3 they decided to have a decent set of std::
 overloads, but then they stupidly also added an llabs() in the same place.
 [[BR]]
 I was hoping that something simple like casting to a double would work,
 but surprize-surprise, that is ambiguously overloaded in GCC4 or later (in
 thye same way that llabs() is).
 [[BR]]
 #ifdef GCC_VERSION is just too ugly - I think I will define a local
 myAbs() instead?

-- 
Ticket URL: <http://cvs.mythtv.org/trac/ticket/1885>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list