Skip to content

Commit 8a53309

Browse files
committed
- fixed "conflicting types for 'reboot'" error in mac OS.
1 parent de2834b commit 8a53309

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

c/include/dynamixel_sdk/packet_handler.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
#include "robotis_def.h"
2626
#include "port_handler.h"
2727

28+
#if defined(__APPLE__)
29+
#undef reboot
30+
#define reboot rebootDXL
31+
#endif
32+
2833
#define BROADCAST_ID 0xFE // 254
2934
#define MAX_ID 0xFC // 252
3035

@@ -101,7 +106,11 @@ WINDECLSPEC uint16_t pingGetModelNum (int port_num, int protocol_version,
101106
WINDECLSPEC void broadcastPing (int port_num, int protocol_version);
102107
WINDECLSPEC uint8_t getBroadcastPingResult (int port_num, int protocol_version, int id);
103108

109+
#if defined(__APPLE__)
110+
WINDECLSPEC void rebootDXL (int port_num, int protocol_version, uint8_t id);
111+
#else
104112
WINDECLSPEC void reboot (int port_num, int protocol_version, uint8_t id);
113+
#endif
105114

106115
WINDECLSPEC void clearMultiTurn (int port_num, int protocol_version, uint8_t id);
107116

c/src/dynamixel_sdk/packet_handler.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,11 @@ uint8_t getBroadcastPingResult(int port_num, int protocol_version, int id)
211211
}
212212
}
213213

214+
#if defined(__APPLE__)
215+
void rebootDXL(int port_num, int protocol_version, uint8_t id)
216+
#else
214217
void reboot(int port_num, int protocol_version, uint8_t id)
218+
#endif
215219
{
216220
if (protocol_version == 1)
217221
{

0 commit comments

Comments
 (0)