Update of /cvsroot/pure-data/externals/io/hidio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17736
Modified Files: hidio.c hidio.h Log Message: added some #defines and #ifdefs in order for code to compile in Windows
Index: hidio.c =================================================================== RCS file: /cvsroot/pure-data/externals/io/hidio/hidio.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** hidio.c 2 Dec 2006 00:24:51 -0000 1.8 --- hidio.c 3 Dec 2006 18:17:36 -0000 1.9 *************** *** 3,6 **** --- 3,7 ---- /* interface to native HID (Human Interface Devices) API */ /* Written by Hans-Christoph Steiner hans@at.or.at */ + /* Max/MSP port by Olaf Matthes olaf.matthes@gmx.de */ /* */ /* Copyright (c) 2004-2006 Hans-Christoph Steiner */ *************** *** 23,32 **** /* */ /* --------------------------------------------------------------------------*/ ! #include <unistd.h> ! #include <stdarg.h> ! #include <stdlib.h> ! #include <string.h> ! #include <ctype.h>
#include "hidio.h" --- 24,37 ---- /* */ /* --------------------------------------------------------------------------*/ ! ! #ifdef _WINDOWS ! /* any Windows specific includes go in here */ ! #else #include <unistd.h> ! #include <ctype.h> ! #endif ! #include <stdarg.h> ! #include <stdlib.h> ! #include <string.h>
#include "hidio.h" *************** *** 84,88 **** { if(message_debug_level <= global_debug_level) ! { char buf[MAXPDSTRING]; va_list ap; --- 89,93 ---- { if(message_debug_level <= global_debug_level) ! { char buf[MAXPDSTRING]; va_list ap; *************** *** 91,95 **** vsnprintf(buf, MAXPDSTRING-1, fmt, ap); post(buf); ! va_end(ap); } } --- 96,101 ---- vsnprintf(buf, MAXPDSTRING-1, fmt, ap); post(buf); ! va_end(ap); ! } } *************** *** 385,390 **** static void hidio_open(t_hidio *x, t_symbol *s, int argc, t_atom *argv) { debug_print(LOG_DEBUG,"hid_%s",s->s_name); - short device_number; pthread_mutex_lock(&x->x_mutex); --- 391,396 ---- static void hidio_open(t_hidio *x, t_symbol *s, int argc, t_atom *argv) { + short device_number; debug_print(LOG_DEBUG,"hid_%s",s->s_name); pthread_mutex_lock(&x->x_mutex); *************** *** 831,835 ****
finder_addclass("Devices", "hidio"); ! post("hidio: © 2006 by Olaf Matthes"); /* pre-generate often used symbols */ --- 837,841 ----
finder_addclass("Devices", "hidio"); ! post("hidio: © 2006 by Hans-Christoph Steiner & Olaf Matthes"); /* pre-generate often used symbols */
Index: hidio.h =================================================================== RCS file: /cvsroot/pure-data/externals/io/hidio/hidio.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** hidio.h 1 Dec 2006 16:27:39 -0000 1.4 --- hidio.h 3 Dec 2006 18:17:36 -0000 1.5 *************** *** 2,8 **** #define _HIDIO_H
! #include <stdio.h> #include <sys/syslog.h> ! #include <pthread.h>
#ifdef __linux__ --- 2,17 ---- #define _HIDIO_H
! #include <stdio.h> ! #ifdef _WINDOWS ! #include "pthread.h" /* needs pthread library */ ! #define LOG_DEBUG 7 ! #define LOG_INFO 6 ! #define LOG_WARNING 4 ! #define vsnprintf _vsnprintf ! #pragma warning (disable: 4305 4244 4761) ! #else #include <sys/syslog.h> ! #include <pthread.h> ! #endif
#ifdef __linux__