Update of /cvsroot/pure-data/externals/OSCx/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8972
Modified Files:
OSC-common.h OSC.c OSCroute.c dumpOSC.c sendOSC.c
Log Message:
fixed up to hopefully build on MinGW gcc 3.4.5 since currently it crashes gcc. I have to say this code is ugly, so its hard to blame gcc. Too many peole just doing quick fixes, and no one caring... I am also guilty as charged. But I did take a moment to remove some warnings
Index: OSC.c
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/OSC.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** OSC.c 30 Aug 2005 20:54:05 -0000 1.6
--- OSC.c 19 Oct 2006 04:13:27 -0000 1.7
***************
*** 18,21 ****
--- 18,22 ----
#define VERSION "0.3"
+ /* this is for when building with non-Microsoft compilers */
#ifndef OSC_API
#define OSC_API
Index: OSCroute.c
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/OSCroute.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** OSCroute.c 30 Aug 2005 20:54:05 -0000 1.6
--- OSCroute.c 19 Oct 2006 04:13:27 -0000 1.7
***************
*** 54,58 ****
#include "OSC-pattern-match.h"
! #ifdef WIN32
#include <stdlib.h>
#include <string.h>
--- 54,58 ----
#include "OSC-pattern-match.h"
! #ifdef _WIN32
#include <stdlib.h>
#include <string.h>
***************
*** 112,115 ****
--- 112,120 ----
/* char *dstString); */
void OSCroute_allmessages(t_OSCroute *x, t_symbol *s, int argc, t_atom *argv);
+ #ifdef _MSC_VER
+ OSC_API void OSCroute_setup(void);
+ #else
+ void OSCroute_setup(void);
+ #endif /* _MSC_VER */
static char *NextSlashOrNull(char *p);
***************
*** 126,130 ****
// setup
! #ifdef WIN32
OSC_API void OSCroute_setup(void) {
#else
--- 131,135 ----
// setup
! #ifdef _MSC_VER
OSC_API void OSCroute_setup(void) {
#else
Index: dumpOSC.c
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/dumpOSC.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** dumpOSC.c 19 Dec 2005 04:11:47 -0000 1.6
--- dumpOSC.c 19 Oct 2006 04:13:27 -0000 1.7
***************
*** 144,152 ****
/* Declarations */
! #ifndef WIN32
static int unixinitudp(int chan);
#endif
! #ifdef WIN32
typedef unsigned __int64 osc_time_t;
#else
--- 144,152 ----
/* Declarations */
! #ifndef _WIN32
static int unixinitudp(int chan);
#endif
! #ifdef _WIN32
typedef unsigned __int64 osc_time_t;
#else
***************
*** 223,227 ****
// while((
! #ifdef WIN32
if ((n = recvfrom(sockfd, mbuf, MAXMESG, 0, (SOCKADDR*)&x->x_server, &clilen)) >0)
#else
--- 223,227 ----
// while((
! #ifdef _WIN32
if ((n = recvfrom(sockfd, mbuf, MAXMESG, 0, (SOCKADDR*)&x->x_server, &clilen)) >0)
#else
***************
*** 346,350 ****
! #ifndef WIN32
#define UNIXDG_PATH "/tmp/htm"
#define UNIXDG_TMP "/tmp/htm.XXXXXX"
--- 346,350 ----
! #ifndef _WIN32
#define UNIXDG_PATH "/tmp/htm"
#define UNIXDG_TMP "/tmp/htm.XXXXXX"
***************
*** 371,375 ****
return sockfd;
}
! #endif // #ifndef WIN32
--- 371,375 ----
return sockfd;
}
! #endif // #ifndef _WIN32
***************
*** 378,382 ****
{
! #ifdef WIN32
struct sockaddr_in serv_addr;
unsigned int sockfd;
--- 378,382 ----
{
! #ifdef _WIN32
struct sockaddr_in serv_addr;
unsigned int sockfd;
***************
*** 421,433 ****
}
-
-
-
-
-
-
-
static void closeudp(int sockfd) {
! #ifdef WIN32
closesocket(sockfd);
#else
--- 421,426 ----
}
static void closeudp(int sockfd) {
! #ifdef _WIN32
closesocket(sockfd);
#else
***************
*** 695,704 ****
static void dumpOSC_Smessage(t_dumpOSC *x, char *address, void *v, int n, ClientAddr returnAddr) {
char *chars = v;
! t_atom at;
//t_atom myargv[50];
! int myargc = x->x_outatc;
! t_atom* mya = x->x_outat;
! int myi;
#ifdef DEBUG
--- 688,697 ----
static void dumpOSC_Smessage(t_dumpOSC *x, char *address, void *v, int n, ClientAddr returnAddr) {
char *chars = v;
! //t_atom at;
//t_atom myargv[50];
! //int myargc = x->x_outatc;
! //t_atom* mya = x->x_outat;
! //int myi;
#ifdef DEBUG
***************
*** 742,746 ****
int myargc = x->x_outatc;
t_atom* mya = x->x_outat;
! int myi;
typeTags = v;
--- 735,739 ----
int myargc = x->x_outatc;
t_atom* mya = x->x_outat;
! //int myi;
typeTags = v;
***************
*** 864,868 ****
int myargc= x->x_outatc;
t_atom* mya = x->x_outat;
! int myi;
--- 857,861 ----
int myargc= x->x_outatc;
t_atom* mya = x->x_outat;
! //int myi;
***************
*** 1011,1013 ****
}
! #endif /* __sgi or LINUX or WIN32 */
--- 1004,1006 ----
}
! #endif /* __sgi or LINUX or _WIN32 */
Index: OSC-common.h
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/OSC-common.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** OSC-common.h 19 Dec 2005 04:11:47 -0000 1.5
--- OSC-common.h 19 Oct 2006 04:13:27 -0000 1.6
***************
*** 49,52 ****
--- 49,59 ----
#ifdef _WIN32
#include <stdio.h>
+ #ifdef _DEBUG
+ #define DEBUG
+ #endif
+ #endif /* _WIN32 */
+
+ /* only needed on Microsoft compilers */
+ #ifdef _MSC_VER
#ifdef OSC_EXPORTS
#define OSC_API __declspec(dllexport)
***************
*** 54,61 ****
#define OSC_API __declspec(dllimport)
#endif
! #ifdef _DEBUG
! #define DEBUG
! #endif
! #endif
//#define int32_t t_int
--- 61,65 ----
#define OSC_API __declspec(dllimport)
#endif
! #endif /* _MSC_VER */
//#define int32_t t_int
Index: sendOSC.c
===================================================================
RCS file: /cvsroot/pure-data/externals/OSCx/src/sendOSC.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** sendOSC.c 12 Apr 2006 14:21:34 -0000 1.6
--- sendOSC.c 19 Oct 2006 04:13:27 -0000 1.7
***************
*** 88,92 ****
! static int exitStatus = 0;
static int useTypeTags = 0;
--- 88,92 ----
! //static int exitStatus = 0;
static int useTypeTags = 0;
***************
*** 246,250 ****
{
char messageName[MAXPDSTRING];
! char *token;
typedArg args[MAX_ARGS];
int i;
--- 246,250 ----
{
char messageName[MAXPDSTRING];
! // char *token;
typedArg args[MAX_ARGS];
int i;
***************
*** 418,422 ****
{
int j, returnVal;
- const int wmERROR = -1;
returnVal = 0;
--- 418,421 ----