[issue1028] cpdup: not 64-bit clean

Michel Salim sinknull at crater.dragonflybsd.org
Wed Jun 11 13:20:52 PDT 2008


Michel Salim <salimma at fedoraproject.org> added the comment:

The 64-bit build errors are due to a namespace clash (or rather C's lack of
one): GLIBC's stat.h internally uses bits/stat.h, which on machines with 64-bit
wordsizes uses __unused for its own purpose. I've attached a patch that renames
every use of __unused in cpdup to __cpdup_unused; it works fine on Linux (the
build instructions will have to be modified accordingly)

_____________________________________________________
DragonFly issue tracker <bugs at lists.dragonflybsd.org>
<https://bugs.dragonflybsd.org/issue1028>
_____________________________________________________--- cpdup-1.11/hcproto.c.unused	2008-06-11 15:08:19.000000000 -0400
+++ cpdup-1.11/hcproto.c	2008-06-11 15:44:51.000000000 -0400
@@ -143,7 +143,7 @@
 }
 
 static int
-rc_hello(hctransaction_t trans, struct HCHead *head __unused)
+rc_hello(hctransaction_t trans, struct HCHead *head __cpdup_unused)
 {
     char hostbuf[256];
 
@@ -879,7 +879,7 @@
 }
 
 static int
-rc_remove(hctransaction_t trans __unused, struct HCHead *head)
+rc_remove(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     const char *path = NULL;
@@ -900,7 +900,7 @@
  * MKDIR
  */
 int
-hc_mkdir(struct HostConf *hc __unused, const char *path, mode_t mode)
+hc_mkdir(struct HostConf *hc __cpdup_unused, const char *path, mode_t mode)
 {
     hctransaction_t trans;
     struct HCHead *head;
@@ -919,7 +919,7 @@
 }
 
 static int
-rc_mkdir(hctransaction_t trans __unused, struct HCHead *head)
+rc_mkdir(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     const char *path = NULL;
@@ -962,7 +962,7 @@
 }
 
 static int
-rc_rmdir(hctransaction_t trans __unused, struct HCHead *head)
+rc_rmdir(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     const char *path = NULL;
@@ -1003,7 +1003,7 @@
 }
 
 static int
-rc_chown(hctransaction_t trans __unused, struct HCHead *head)
+rc_chown(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     const char *path = NULL;
@@ -1052,7 +1052,7 @@
 }
 
 static int
-rc_lchown(hctransaction_t trans __unused, struct HCHead *head)
+rc_lchown(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     const char *path = NULL;
@@ -1100,7 +1100,7 @@
 }
 
 static int
-rc_chmod(hctransaction_t trans __unused, struct HCHead *head)
+rc_chmod(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     const char *path = NULL;
@@ -1145,7 +1145,7 @@
 }
 
 static int
-rc_mknod(hctransaction_t trans __unused, struct HCHead *head)
+rc_mknod(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     const char *path = NULL;
@@ -1193,7 +1193,7 @@
 }
 
 static int
-rc_link(hctransaction_t trans __unused, struct HCHead *head)
+rc_link(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     const char *name1 = NULL;
@@ -1238,7 +1238,7 @@
 }
 
 static int
-rc_chflags(hctransaction_t trans __unused, struct HCHead *head)
+rc_chflags(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     const char *path = NULL;
@@ -1394,7 +1394,7 @@
 }
 
 static int
-rc_symlink(hctransaction_t trans __unused, struct HCHead *head)
+rc_symlink(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     const char *name1 = NULL;
@@ -1438,7 +1438,7 @@
 }
 
 static int
-rc_rename(hctransaction_t trans __unused, struct HCHead *head)
+rc_rename(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     const char *name1 = NULL;
@@ -1483,7 +1483,7 @@
 }
 
 static int
-rc_utimes(hctransaction_t trans __unused, struct HCHead *head)
+rc_utimes(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     struct HCLeaf *item;
     struct timeval times[2];
--- cpdup-1.11/hclink.c.unused	2008-05-24 13:21:36.000000000 -0400
+++ cpdup-1.11/hclink.c	2008-06-11 15:44:30.000000000 -0400
@@ -77,7 +77,7 @@
 }
 
 static int
-rc_badop(hctransaction_t trans __unused, struct HCHead *head)
+rc_badop(hctransaction_t trans __cpdup_unused, struct HCHead *head)
 {
     head->error = EOPNOTSUPP;
     return(0);
@@ -353,7 +353,7 @@
 }
 
 void
-hcc_free_trans(struct HostConf *hc __unused)
+hcc_free_trans(struct HostConf *hc __cpdup_unused)
 {
     /* nop */
 }




More information about the Bugs mailing list