@@ -138,6 +138,8 @@ int main (void)
138
138
#if __WIN32__
139
139
#include <wchar.h>
140
140
#include "hidapi.h"
141
+ #elif __APPLE__
142
+ #include "hidapi.h"
141
143
#else
142
144
#include <libudev.h>
143
145
#include <sys/types.h>
@@ -240,7 +242,7 @@ static int cm108_write (char *name, int iomask, int iodata);
240
242
241
243
// Used to process regular expression matching results.
242
244
243
- #ifndef __WIN32__
245
+ #if !defined( __WIN32__ ) && !defined( __APPLE__ )
244
246
245
247
static void substr_se (char * dest , const char * src , int start , int endp1 )
246
248
{
@@ -317,7 +319,7 @@ static void usage(void)
317
319
dw_printf ("Usage: cm108 [ device-path [ gpio-num ] ]\n" );
318
320
dw_printf ("\n" );
319
321
dw_printf ("With no command line arguments, this will produce a list of\n" );
320
- #if __WIN32__
322
+ #if __WIN32__ || __APPLE__
321
323
dw_printf ("Human Interface Devices (HID) and indicate which ones can be\n" );
322
324
dw_printf ("used for GPIO PTT.\n" );
323
325
#else
@@ -375,11 +377,11 @@ int main (int argc, char **argv)
375
377
376
378
num_things = cm108_inventory (things , MAXX_THINGS );
377
379
378
- #if __WIN32__
380
+ #if __WIN32__ || __APPLE__
379
381
380
- /////////////////////////////////////////////////////
381
- // Windows - Remove the sound related columns for now.
382
- /////////////////////////////////////////////////////
382
+ ////////////////////////////////////////////////////////////
383
+ // Windows & Mac - Remove the sound related columns for now.
384
+ ////////////////////////////////////////////////////////////
383
385
384
386
dw_printf (" VID PID %-*s %-*s"
385
387
"\n" , (int )sizeof (things [0 ].product ), "Product" ,
@@ -539,7 +541,7 @@ int cm108_inventory (struct thing_s *things, int max_things)
539
541
int num_things = 0 ;
540
542
memset (things , 0 , sizeof (struct thing_s ) * max_things );
541
543
542
- #if __WIN32__
544
+ #if __WIN32__ || __APPLE__
543
545
544
546
struct hid_device_info * devs , * cur_dev ;
545
547
@@ -779,7 +781,7 @@ void cm108_find_ptt (char *output_audio_device, char *ptt_device, int ptt_devic
779
781
// Possible improvement: Skip if inventory already taken.
780
782
num_things = cm108_inventory (things , MAXX_THINGS );
781
783
782
- #if __WIN32__
784
+ #if __WIN32__ || __APPLE__
783
785
// FIXME - This is just a half baked implementation.
784
786
// I have not been able to figure out how to find the connection
785
787
// between the audio device and HID in the same package.
@@ -934,7 +936,7 @@ int cm108_set_gpio_pin (char *name, int num, int state)
934
936
static int cm108_write (char * name , int iomask , int iodata )
935
937
{
936
938
937
- #if __WIN32__
939
+ #if __WIN32__ || __APPLE__
938
940
939
941
//text_color_set(DW_COLOR_DEBUG);
940
942
//dw_printf ("TEMP DEBUG cm108_write: %s %d %d\n", name, iomask, iodata);
0 commit comments