aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-10-16 19:04:11 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2012-10-16 19:04:11 +0000
commitf82a2e687cc49d89a93c007ee66e682a3da4bc20 (patch)
treeae2879d49b3e23d0f823d800db469091ab8241c8
parentf6900774ddec90855dd3aaa1b5bf1a6af4b28f21 (diff)
use Microsoft standard macro: _WIN32 http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.80%29.aspx
svn path=/branches/pd-extended/0.43/externals/oscx/; revision=16402
-rw-r--r--OSC-client.c6
-rw-r--r--htmsocket.c18
-rw-r--r--sendOSC.c2
3 files changed, 13 insertions, 13 deletions
diff --git a/OSC-client.c b/OSC-client.c
index cea9e78..99645fa 100644
--- a/OSC-client.c
+++ b/OSC-client.c
@@ -52,7 +52,7 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#define DONE 4 /* All open bundles have been closed, so can't write
anything else */
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#include <io.h>
#include <stdio.h>
@@ -75,7 +75,7 @@ MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
char *OSC_errorMessage;
-#ifndef WIN32
+#ifndef _WIN32
static int strlen(char *s);
#endif
static int OSC_padString(char *dest, char *str);
@@ -427,7 +427,7 @@ int OSC_writeStringArg(OSCbuf *buf, char *arg) {
/* String utilities */
-#ifndef WIN32
+#ifndef _WIN32
static int strlen(char *s) {
int i;
for (i=0; s[i] != '\0'; i++) /* Do nothing */ ;
diff --git a/htmsocket.c b/htmsocket.c
index 16a1050..e6b6a73 100644
--- a/htmsocket.c
+++ b/htmsocket.c
@@ -45,7 +45,7 @@ The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl
#include <string.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
#include <sys/types.h>
#include <sys/stat.h>
#include <winsock2.h>
@@ -95,7 +95,7 @@ typedef struct
float srate;
struct sockaddr_in serv_addr; /* udp socket */
- #ifndef WIN32
+ #ifndef _WIN32
struct sockaddr_un userv_addr; /* UNIX socket */
#endif
int sockfd; /* socket file descriptor */
@@ -129,7 +129,7 @@ int IsAddressMulticast(unsigned long address)
void *OpenHTMSocket(char *host, int portnumber, short *multicast_TTL)
{
struct sockaddr_in cl_addr;
- #ifndef WIN32
+ #ifndef _WIN32
int sockfd;
struct sockaddr_un ucl_addr;
#else
@@ -143,7 +143,7 @@ void *OpenHTMSocket(char *host, int portnumber, short *multicast_TTL)
if(!o)
return 0;
- #ifndef WIN32
+ #ifndef _WIN32
if(!host)
{
@@ -202,7 +202,7 @@ void *OpenHTMSocket(char *host, int portnumber, short *multicast_TTL)
*/
o->len = sizeof(cl_addr);
- #ifdef WIN32
+ #ifdef _WIN32
ZeroMemory((char *)&o->serv_addr, sizeof(o->serv_addr));
#else
bzero((char *)&o->serv_addr, sizeof(o->serv_addr));
@@ -221,7 +221,7 @@ void *OpenHTMSocket(char *host, int portnumber, short *multicast_TTL)
hostsEntry = gethostbyname(host);
if (hostsEntry == NULL) {
fprintf(stderr, "Couldn't decipher host name \"%s\"\n", host);
- #ifndef WIN32
+ #ifndef _WIN32
herror(NULL);
#endif
return 0;
@@ -240,7 +240,7 @@ void *OpenHTMSocket(char *host, int portnumber, short *multicast_TTL)
*/
- #ifdef WIN32
+ #ifdef _WIN32
o->serv_addr.sin_port = htons((USHORT)portnumber);
o->addr = &(o->serv_addr);
if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) != INVALID_SOCKET) {
@@ -336,7 +336,7 @@ void *OpenHTMSocket(char *host, int portnumber, short *multicast_TTL)
else { perror("unable to make socket\n");}
#endif
}
- #ifdef WIN32
+ #ifdef _WIN32
if(sockfd == INVALID_SOCKET) {
#else
if(sockfd < 0) {
@@ -370,7 +370,7 @@ bool SendHTMSocket(void *htmsendhandle, int length_in_bytes, void *buffer)
void CloseHTMSocket(void *htmsendhandle)
{
desc *o = (desc *)htmsendhandle;
- #ifdef WIN32
+ #ifdef _WIN32
if(SOCKET_ERROR == closesocket(o->sockfd)) {
perror("CloseHTMSocket::closesocket failed\n");
return;
diff --git a/sendOSC.c b/sendOSC.c
index 0335101..4a4c687 100644
--- a/sendOSC.c
+++ b/sendOSC.c
@@ -62,7 +62,7 @@ The OSC webpage is http://cnmat.cnmat.berkeley.edu/OpenSoundControl
#include <string.h>
#include <stdlib.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#else
#include <stdio.h>