[116109] trunk/base/src/machista1.0/libmachista.c

cal at macports.org cal at macports.org
Sat Jan 18 15:23:05 PST 2014


Revision: 116109
          https://trac.macports.org/changeset/116109
Author:   cal at macports.org
Date:     2014-01-18 15:23:05 -0800 (Sat, 18 Jan 2014)
Log Message:
-----------
machista: fix build on Tiger PPC, closes #42186

Modified Paths:
--------------
    trunk/base/src/machista1.0/libmachista.c

Modified: trunk/base/src/machista1.0/libmachista.c
===================================================================
--- trunk/base/src/machista1.0/libmachista.c	2014-01-18 23:22:07 UTC (rev 116108)
+++ trunk/base/src/machista1.0/libmachista.c	2014-01-18 23:23:05 UTC (rev 116109)
@@ -30,6 +30,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include <config.h>
+
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -532,7 +534,17 @@
 
 /* Returns string representation of the MACHO_* error code constants */
 const char *macho_strerror(int err) {
-    int num = fls(err);
+    int num;
+#ifdef HAVE_FLS
+    num = fls(err);
+#else
+    /* Tiger compatibility, see #42186 */
+    num = 0;
+    while (err > 0) {
+        err >>= 1;
+        num++;
+    }
+#endif
 
     static char *errors[] = {
         /* 0x00 */ "Success",
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140118/e6699319/attachment-0001.html>


More information about the macports-changes mailing list