]> git.sur5r.net Git - openocd/commitdiff
Fix compile failure on MacOSX
authorMatthias Welwarsky <matthias.welwarsky@sysgo.com>
Tue, 2 May 2017 14:47:21 +0000 (16:47 +0200)
committerFreddie Chopin <freddie.chopin@gmail.com>
Tue, 2 May 2017 15:43:20 +0000 (16:43 +0100)
MacOSX tool chain defines __unused in "sys/cdefs.h", causing a collision.
Remove the local define to avoid polluting the compilers internal
symbol namespace.

Change-Id: I16370c4518e6aeec482dd689e7db80628f846ee3
Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com>
Reviewed-on: http://openocd.zylin.com/4118
Reviewed-by: Steven Stallion <sstallion@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
src/target/aarch64.c
src/target/armv8.c

index e647bba13649c99d9a27b3fb359ea84ca570090e..5e5d3fc7fa7babeee7d87f78e1d4b3d4b4649f3f 100644 (file)
@@ -30,8 +30,6 @@
 #include "armv8_cache.h"
 #include <helper/time_support.h>
 
-#define __unused __attribute((unused))
-
 enum restart_mode {
        RESTART_LAZY,
        RESTART_SYNC,
index db7a8717b3dc02892483fd2fe620ec61cb7288ef..df5e25102f0c9a9dee42a30756520a3ff8d52e15 100644 (file)
@@ -37,8 +37,6 @@
 #include "target.h"
 #include "target_type.h"
 
-#define __unused __attribute__((unused))
-
 static const char * const armv8_state_strings[] = {
        "AArch32", "Thumb", "Jazelle", "ThumbEE", "AArch64",
 };
@@ -610,7 +608,7 @@ done:
        /* (void) */ dpm->finish(dpm);
 }
 
-static __unused void armv8_show_fault_registers(struct target *target)
+static __attribute__((unused)) void armv8_show_fault_registers(struct target *target)
 {
        struct armv8_common *armv8 = target_to_armv8(target);
 
@@ -647,7 +645,7 @@ static uint8_t armv8_pa_size(uint32_t ps)
        return ret;
 }
 
-static __unused int armv8_read_ttbcr32(struct target *target)
+static __attribute__((unused)) int armv8_read_ttbcr32(struct target *target)
 {
        struct armv8_common *armv8 = target_to_armv8(target);
        struct arm_dpm *dpm = armv8->arm.dpm;
@@ -686,7 +684,7 @@ done:
        return retval;
 }
 
-static __unused int armv8_read_ttbcr(struct target *target)
+static __attribute__((unused)) int armv8_read_ttbcr(struct target *target)
 {
        struct armv8_common *armv8 = target_to_armv8(target);
        struct arm_dpm *dpm = armv8->arm.dpm;