aboutsummaryrefslogtreecommitdiff
path: root/hidio.c
diff options
context:
space:
mode:
authorOlaf Matthes <olafmatt@users.sourceforge.net>2006-12-03 18:17:36 +0000
committerOlaf Matthes <olafmatt@users.sourceforge.net>2006-12-03 18:17:36 +0000
commit90c9041976723a669b02deffa75853a85c0343cb (patch)
tree01924d564bd6c1ef06f7aa3be101b11720581c79 /hidio.c
parenta752a4459e38b3ef9c392bb5a0d85f7268f7ae42 (diff)
added some #defines and #ifdefs in order for code to compile in Windows
svn path=/trunk/externals/io/hidio/; revision=6604
Diffstat (limited to 'hidio.c')
-rw-r--r--hidio.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/hidio.c b/hidio.c
index a06e9ba..8562b0c 100644
--- a/hidio.c
+++ b/hidio.c
@@ -2,6 +2,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 */
/* */
@@ -22,12 +23,16 @@
/* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* */
/* --------------------------------------------------------------------------*/
-
+
+#ifdef _WINDOWS
+/* any Windows specific includes go in here */
+#else
#include <unistd.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
+#include <ctype.h>
+#endif
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
#include "hidio.h"
@@ -83,14 +88,15 @@ static void hidio_open(t_hidio *x, t_symbol *s, int argc, t_atom *argv);
void debug_print(t_int message_debug_level, const char *fmt, ...)
{
if(message_debug_level <= global_debug_level)
- {
+ {
char buf[MAXPDSTRING];
va_list ap;
//t_int arg[8];
va_start(ap, fmt);
vsnprintf(buf, MAXPDSTRING-1, fmt, ap);
post(buf);
- va_end(ap);
+ va_end(ap);
+
}
}
@@ -384,8 +390,8 @@ t_int hidio_close(t_hidio *x)
*/
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);
- short device_number;
pthread_mutex_lock(&x->x_mutex);
device_number = get_device_number_from_arguments(argc, argv);
@@ -830,7 +836,7 @@ int main()
hidio_class = c;
finder_addclass("Devices", "hidio");
- post("hidio: 2006 by Olaf Matthes");
+ post("hidio: 2006 by Hans-Christoph Steiner & Olaf Matthes");
/* pre-generate often used symbols */
ps_open = gensym("open");