[21961] trunk/dports/net/aria2

source_changes at macosforge.org source_changes at macosforge.org
Mon Feb 12 08:26:01 PST 2007


Revision: 21961
          http://trac.macosforge.org/projects/macports/changeset/21961
Author:   eridius at macports.org
Date:     2007-02-12 08:26:01 -0800 (Mon, 12 Feb 2007)

Log Message:
-----------
Commit a new patch by the author of aria2 to more officially fix the compilation error
Apparently it was caused by different ordering of static variable initializers between linux and darwin. Go figure

Modified Paths:
--------------
    trunk/dports/net/aria2/Portfile

Added Paths:
-----------
    trunk/dports/net/aria2/files/patch-FixCompilation

Removed Paths:
-------------
    trunk/dports/net/aria2/files/patch-SharedHandle.h

Modified: trunk/dports/net/aria2/Portfile
===================================================================
--- trunk/dports/net/aria2/Portfile	2007-02-12 15:45:33 UTC (rev 21960)
+++ trunk/dports/net/aria2/Portfile	2007-02-12 16:26:01 UTC (rev 21961)
@@ -25,7 +25,8 @@
 				--with-libintl-prefix=${prefix} \
 				--with-xml-prefix=${prefix}
 
-patchfiles      patch-SharedHandle.h
+# patchfiles      patch-SharedHandle.h
+patchfiles      patch-FixCompilation
 
 platform darwin 8 {
 	configure.env-append CC=/usr/bin/gcc-4.0 CXX=/usr/bin/g++-4.0

Added: trunk/dports/net/aria2/files/patch-FixCompilation
===================================================================
--- trunk/dports/net/aria2/files/patch-FixCompilation	                        (rev 0)
+++ trunk/dports/net/aria2/files/patch-FixCompilation	2007-02-12 16:26:01 UTC (rev 21961)
@@ -0,0 +1,94 @@
+--- src/BitfieldManFactory.cc	2006-12-24 15:25:21.000000000 +0900
++++ src/BitfieldManFactory.cc	2007-02-12 21:05:55.000000000 +0900
+@@ -35,6 +35,6 @@
+ #include "BitfieldManFactory.h"
+ #include "SimpleRandomizer.h"
+ 
+-RandomizerHandle BitfieldManFactory::defaultRandomizer = SimpleRandomizer::getInstance();
++BitfieldManFactoryHandle BitfieldManFactory::factory = 0;
+ 
+-BitfieldManFactory::BitfieldManFactory():randomizer(defaultRandomizer) {}
++BitfieldManFactory::BitfieldManFactory():randomizer(0) {}
+--- src/BitfieldManFactory.h	2007-02-06 23:49:22.000000000 +0900
++++ src/BitfieldManFactory.h	2007-02-12 21:05:55.000000000 +0900
+@@ -45,15 +45,18 @@
+ 
+ class BitfieldManFactory {
+ private:
+-  static RandomizerHandle defaultRandomizer;
++  static BitfieldManFactoryHandle factory;
++
+   RandomizerHandle randomizer;
+ 
+   BitfieldManFactory();
+ public:
+   ~BitfieldManFactory() {}
+ 
+-  static BitfieldManFactoryHandle getNewFactory() {
+-    BitfieldManFactoryHandle factory = new BitfieldManFactory();
++  static BitfieldManFactoryHandle getFactoryInstance() {
++    if(factory.isNull()) {
++      factory = new BitfieldManFactory();
++    }
+     return factory;
+   }
+ 
+@@ -64,11 +67,12 @@
+   }
+ 
+   static void setDefaultRandomizer(const RandomizerHandle& randomizer) {
+-    defaultRandomizer = randomizer;
++    BitfieldManFactoryHandle factory = getFactoryInstance();
++    factory->setRandomizer(randomizer);
+   }
+ 
+   static RandomizerHandle getDefaultRandomizer() {
+-    return defaultRandomizer;
++    return getFactoryInstance()->getRandomizer();
+   }
+ 
+   void setRandomizer(const RandomizerHandle& randomizer) {
+--- src/DefaultPieceStorage.cc	2007-01-28 23:18:35.000000000 +0900
++++ src/DefaultPieceStorage.cc	2007-02-12 21:05:55.000000000 +0900
+@@ -52,7 +52,7 @@
+   option(option)
+ {
+   bitfieldMan =
+-    BitfieldManFactory::getNewFactory()->
++    BitfieldManFactory::getFactoryInstance()->
+     createBitfieldMan(btContext->getPieceLength(),
+ 		      btContext->getTotalLength());
+   logger = LogFactory::getInstance();
+--- src/Peer.cc	2006-12-24 15:25:21.000000000 +0900
++++ src/Peer.cc	2007-02-12 21:05:55.000000000 +0900
+@@ -46,7 +46,7 @@
+   active(false)
+ {
+   resetStatus();
+-  this->bitfield = BitfieldManFactory::getNewFactory()->
++  this->bitfield = BitfieldManFactory::getFactoryInstance()->
+     createBitfieldMan(pieceLength, totalLength);
+   string idSeed = ipaddr+":"+Util::itos(port);
+   id = Util::simpleMessageDigest(idSeed);
+--- src/Piece.cc	2006-12-24 15:25:21.000000000 +0900
++++ src/Piece.cc	2007-02-12 21:05:55.000000000 +0900
+@@ -40,7 +40,7 @@
+ 
+ Piece::Piece(int index, int length):index(index), length(length) {
+   bitfield =
+-    BitfieldManFactory::getNewFactory()->createBitfieldMan(BLOCK_LENGTH, length);
++    BitfieldManFactory::getFactoryInstance()->createBitfieldMan(BLOCK_LENGTH, length);
+ }
+ 
+ Piece::Piece(const Piece& piece) {
+--- src/SegmentMan.cc	2007-02-06 23:49:22.000000000 +0900
++++ src/SegmentMan.cc	2007-02-12 21:05:55.000000000 +0900
+@@ -238,7 +238,7 @@
+ 
+ void SegmentMan::initBitfield(int segmentLength, long long int totalLength) {
+   delete bitfield;
+-  this->bitfield = BitfieldManFactory::getNewFactory()->createBitfieldMan(segmentLength, totalLength);
++  this->bitfield = BitfieldManFactory::getFactoryInstance()->createBitfieldMan(segmentLength, totalLength);
+ }
+ 
+ Segment SegmentMan::checkoutSegment(int cuid, int index) {
\ No newline at end of file

Deleted: trunk/dports/net/aria2/files/patch-SharedHandle.h
===================================================================
--- trunk/dports/net/aria2/files/patch-SharedHandle.h	2007-02-12 15:45:33 UTC (rev 21960)
+++ trunk/dports/net/aria2/files/patch-SharedHandle.h	2007-02-12 16:26:01 UTC (rev 21961)
@@ -1,25 +0,0 @@
---- src/SharedHandle.h.bak	2007-02-12 03:51:25.000000000 -0500
-+++ src/SharedHandle.h	2007-02-12 03:51:45.000000000 -0500
-@@ -76,13 +76,15 @@
-   RefCount* ucount;
- 
-   void releaseReference() {
--    if(--ucount->strongRefCount == 0) {
--      delete obj;
--      obj = 0;
--    }
--    if(--ucount->totalRefCount == 0) {
--      delete ucount;
--      ucount = 0;
-+    if(ucount != 0) {
-+      if(--ucount->strongRefCount == 0) {
-+        delete obj;
-+        obj = 0;
-+      }
-+      if(--ucount->totalRefCount == 0) {
-+        delete ucount;
-+        ucount = 0;
-+      }
-     }
-   }
- 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070212/dc31150e/attachment.html


More information about the macports-changes mailing list