Mercurial > hg > touchkeys
diff Source/TouchKeys/Osc.h @ 22:48e3f67b5fe0
Merge, and starting condensing all the platform-specific serial code into just a few methods.
author | Andrew McPherson <andrewm@eecs.qmul.ac.uk> |
---|---|
date | Tue, 11 Feb 2014 18:19:34 +0000 |
parents | dfff66c07936 |
children | 90ce403d0dc5 |
line wrap: on
line diff
--- a/Source/TouchKeys/Osc.h Tue Feb 11 13:11:20 2014 +0000 +++ b/Source/TouchKeys/Osc.h Tue Feb 11 18:19:34 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);