diff Source/TouchKeys/Osc.h @ 20:dfff66c07936

Lots of minor changes to support building on Visual Studio. A few MSVC-specific #ifdefs to eliminate things Visual Studio doesn't like. This version now compiles on Windows (provided liblo, Juce and pthread are present) but the TouchKeys device support is not yet enabled. Also, the code now needs to be re-checked on Mac and Linux.
author Andrew McPherson <andrewm@eecs.qmul.ac.uk>
date Sun, 09 Feb 2014 18:40:51 +0000
parents f943785252fc
children 48e3f67b5fe0
line wrap: on
line diff
--- a/Source/TouchKeys/Osc.h	Sat Dec 07 18:44:48 2013 +0000
+++ b/Source/TouchKeys/Osc.h	Sun Feb 09 18:40:51 2014 +0000
@@ -24,6 +24,7 @@
 #ifndef OSC_H
 #define OSC_H
 
+#include <cstdint>
 #include <iostream>
 #include <iomanip>
 #include <fstream>
@@ -32,8 +33,8 @@
 #include <string>
 #include <vector>
 #include <set>
+#include "lo/lo.h"
 #include "../JuceLibraryCode/JuceHeader.h"
-#include "lo/lo.h"
 
 using namespace std;
 
@@ -104,8 +105,12 @@
         // Only start the server if the port is positive
         if(port > 0) {
             char portStr[16];
+#ifdef _MSC_VER
+			_snprintf_s(portStr, 16, _TRUNCATE, "%d", port);
+#else
             snprintf(portStr, 16, "%d", port);
-            
+#endif
+
             oscServerThread_ = lo_server_thread_new(portStr, staticErrorHandler);
             if(oscServerThread_ != 0) {
                 lo_server_thread_add_method(oscServerThread_, NULL, NULL, OscReceiver::staticHandler, (void *)this);