Patch 03

[email protected]
Newsgroups gmane.comp.gnu.gift.general
Message-ID <[email protected]>
This patch fixes a simple cast error, by including wordsize.h, to tell wether we're 32 or 64 bit.

required for AMD64 compilation. Committing.

Julia Longtin <[email protected]>

_______________________________________________
help-GIFT mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gift
03-ChangeLog (text/plain, 542 B)
--- ../../dev3/gift/ChangeLog	2006-11-18 12:03:45.000000000 -0600
+++ ChangeLog	2006-11-18 12:18:55.000000000 -0600
@@ -8,6 +8,9 @@
 	* dtd/Makefile.am
 	make mv invocations use ${top_builddir}, so that we can build gift in a directory other than ${srcdir}
 	replace "../" with appropriate autoconf variables.
+	* libMRML/cc/CAttributeList.cc
+	include wordsize.h, so we can tell if we're a 64 or 32bit binary during build.
+	when dumping pointer as int, check the size of the pointer before casting.
 
 2006-10-10    <[email protected]>
03-libMRML_cc_CAttributeList_cc-check_size_of_pointer_before_dumping.patch (text/plain, 1 KB)
--- ../../dev3/gift/libMRML/cc/CAttributeList.cc	2006-02-28 07:48:22.000000000 -0600
+++ libMRML/cc/CAttributeList.cc	2006-11-18 12:14:09.000000000 -0600
@@ -27,6 +27,8 @@
 #include "libMRML/include/CMutex.h"
 #include <iostream>
 #include <algorithm>
+/* for __WORDSIZE */
+#include <bits/wordsize.h>
 extern CMutex* gMutex;
 
 CAttributeList::CAttributeList(const char * const * const inAttributeList){
@@ -94,7 +96,11 @@
       
     if(strcmp(i->second.first,
 		   i->second.second)){
-      cout << "DELETING FAILED" << flush << int(i->second.second) << flush << i->second.first << i->second.second << endl;
+#if __WORDSIZE==64 /* this should tell us what size a float* is, so that we can dump it properly.. */
+      cout << "DELETING FAILED" << flush << int64_t(i->second.second) << flush << i->second.first << i->second.second << endl;
+#else
+      cout << "DELETING FAILED" << flush << int32_t(i->second.second) << flush << i->second.first << i->second.second << endl;
+#endif
       assert(0);
     }
     delete[] i->second.first;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.