[DragonFlyBSD - Bug #2461] INT64_MAX, INT64_MIN long long definition conflicts on x86_64 with firefox 17.0esr build

David Shao via Redmine bugtracker-admin at leaf.dragonflybsd.org
Thu Nov 29 17:12:25 PST 2012


Issue #2461 has been updated by David Shao.


In combination with
commit 38aa22ba71414a9ac96065bea03c600d63f289d5
Date:   Thu Nov 29 00:26:41 2012 +0100
    <sys/errno.h>: Try to fix errno's declaration a bit better for C++.

the provided fix after
# make quickworld && make buildkernel
on x86_64 now allows Firefox 17.0 esr to build and function correctly using pkgsrc current master.  Thanks!
----------------------------------------
Bug #2461: INT64_MAX,INT64_MIN long long definition conflicts on x86_64 with firefox 17.0esr build
http://bugs.dragonflybsd.org/issues/2461

Author: David Shao
Status: Feedback
Priority: Normal
Assignee: 
Category: 
Target version: 


On current pkgsrc master, 3.3-DEVELOPMENT x86_64, building devel/xulrunner, associated with firefox 17.0esr, fails processing a C++ header file with an error message:

In file included from ../../dist/include/mozilla/FunctionTimer.h:11,
                 from /usr/pkgsrc/devel/xulrunner/work/mozilla-esr17/xpcom/glue/FileUtils.cpp:20:
../../dist/include/mozilla/TimeStamp.h: In static member function 'static mozilla::TimeDuration mozilla::TimeDuration::FromTicks(double)':
../../dist/include/mozilla/TimeStamp.h:137: error: call of overloaded 'FromTicks(long long int)' is ambiguous
../../dist/include/mozilla/TimeStamp.h:123: note: candidates are: static mozilla::TimeDuration mozilla::TimeDuration::FromTicks(int64_t)
../../dist/include/mozilla/TimeStamp.h:129: note:                 static mozilla::TimeDuration mozilla::TimeDuration::FromTicks(double)
gmake[4]: *** [FileUtils.o] Error 1

The relevant lines from the original TimeStamp.h located under devel/xulrunner/work/mozilla-esr17/xpcom/ds appear to be:

  static TimeDuration FromTicks(int64_t aTicks) {
    TimeDuration t;
    t.mValue = aTicks;
    return t;
  }

  static TimeDuration FromTicks(double aTicks) {
    // NOTE: this MUST be a >= test, because int64_t(double(INT64_MAX))
    // overflows and gives LL_MININT.
    if (aTicks >= double(INT64_MAX))
      return TimeDuration::FromTicks(INT64_MAX);

    // This MUST be a <= test.
    if (aTicks <= double(INT64_MIN))
      return TimeDuration::FromTicks(INT64_MIN);

    return TimeDuration::FromTicks(int64_t(aTicks));
  }

  // Duration in PRIntervalTime units
  int64_t mValue;


A patch explictly casting in the above header file TimeStamp.h both INT64_MAX and INT64_MIN to int64_t allows building to at least proceed past the previous error.

Grepping for INT64_MAX and INT64_MIN under /usr/include reveals definitions:
#define      INT64_MAX       0x7fffffffffffffffLL
#define      INT64_MIN     (-0x7fffffffffffffffLL-1)

The compiler being used is:
$ cc --version
cc (DragonFly) 4.4.7 2012.03.13





-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account



More information about the Bugs mailing list