Update of /cvsroot/pure-data/externals/ext13 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19127
Modified Files: filesize.c ftos.c mandelbrot.c openpatch.c piperead~.c scramble~.c sfread.c sfwrite13~.c streamin13~.c streamout13~.c strippath.c wavinfo.c Log Message: MinGW cleanups
Index: strippath.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/strippath.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** strippath.c 14 Nov 2005 21:44:23 -0000 1.3 --- strippath.c 24 Sep 2006 22:58:10 -0000 1.4 *************** *** 3,7 **** #include <sys/stat.h> #include <stdio.h> ! #ifndef NT #include <unistd.h> #endif --- 3,7 ---- #include <sys/stat.h> #include <stdio.h> ! #ifndef _WIN32 #include <unistd.h> #endif
Index: sfread.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/sfread.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sfread.c 14 Nov 2005 21:44:23 -0000 1.2 --- sfread.c 24 Sep 2006 22:58:10 -0000 1.3 *************** *** 15,19 **** /* ------------------------ sfread~ ----------------------------- */
! #ifdef NT #define BINREADMODE "rb" #else --- 15,19 ---- /* ------------------------ sfread~ ----------------------------- */
! #ifdef _WIN32 #define BINREADMODE "rb" #else
Index: mandelbrot.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/mandelbrot.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mandelbrot.c 14 Nov 2005 21:44:23 -0000 1.3 --- mandelbrot.c 24 Sep 2006 22:58:10 -0000 1.4 *************** *** 4,8 **** #include <stdio.h> #include <string.h> ! #ifndef NT #include <unistd.h> #endif --- 4,8 ---- #include <stdio.h> #include <string.h> ! #ifndef _WIN32 #include <unistd.h> #endif
Index: filesize.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/filesize.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** filesize.c 14 Nov 2005 21:44:23 -0000 1.3 --- filesize.c 24 Sep 2006 22:58:10 -0000 1.4 *************** *** 3,7 **** #include <sys/stat.h> #include <stdio.h> ! #ifndef NT #include <unistd.h> #endif --- 3,7 ---- #include <sys/stat.h> #include <stdio.h> ! #ifndef _WIN32 #include <unistd.h> #endif
Index: streamin13~.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/streamin13~.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** streamin13~.c 2 Dec 2005 03:16:55 -0000 1.7 --- streamin13~.c 24 Sep 2006 22:58:10 -0000 1.8 *************** *** 6,10 **** #include <sys/types.h> #include <string.h> ! #if defined(UNIX) || defined(unix) #include <sys/socket.h> #include <sys/errno.h> --- 6,12 ---- #include <sys/types.h> #include <string.h> ! #ifdef _WIN32 ! #include <winsock2.h> ! #else #include <sys/socket.h> #include <sys/errno.h> *************** *** 14,19 **** #include <unistd.h> #define SOCKET_ERROR -1 - #else - #include <winsock2.h> #endif
--- 16,19 ---- *************** *** 31,39 **** static void sys_sockerror(char *s) { ! #if defined(UNIX) || defined(unix) ! int err = errno; ! #else int err = WSAGetLastError(); if (err == 10054) return; #endif post("%s: %s (%d)\n", s, strerror(err), err); --- 31,39 ---- static void sys_sockerror(char *s) { ! #ifdef _WIN32 int err = WSAGetLastError(); if (err == 10054) return; + #else + int err = errno; #endif post("%s: %s (%d)\n", s, strerror(err), err); *************** *** 43,51 **** static void sys_closesocket(int fd) { ! #if defined(UNIX) || defined(unix) ! close(fd); ! #endif ! #ifdef NT closesocket(fd); #endif } --- 43,50 ---- static void sys_closesocket(int fd) { ! #ifdef _WIN32 closesocket(fd); + #else + close(fd); #endif } *************** *** 92,96 **** static int on = 1;
! #ifndef NT shutdown(x->x_connectsocket,SHUT_RDWR); #else --- 91,95 ---- static int on = 1;
! #ifndef _WIN32 shutdown(x->x_connectsocket,SHUT_RDWR); #else *************** *** 176,180 **** short* cbuf;
! #ifndef NT t_float *out[x->x_n]; #else --- 175,179 ---- short* cbuf;
! #ifndef _WIN32 t_float *out[x->x_n]; #else *************** *** 182,186 **** #endif
! #ifndef NT fd_set fdset; #endif --- 181,185 ---- #endif
! #ifndef _WIN32 fd_set fdset; #endif *************** *** 198,202 **** // cbuf = x->cbuf + x->blockssincereceive * n * x->x_n;
! #ifndef NT FD_SET(x->x_connectsocket,&fdset); if (!select(x->x_connectsocket+1,&fdset,NULL,NULL,&timeout) --- 197,201 ---- // cbuf = x->cbuf + x->blockssincereceive * n * x->x_n;
! #ifndef _WIN32 FD_SET(x->x_connectsocket,&fdset); if (!select(x->x_connectsocket+1,&fdset,NULL,NULL,&timeout) *************** *** 274,278 **** } } ! #ifdef NT free(out); #endif --- 273,277 ---- } } ! #ifdef _WIN32 free(out); #endif
Index: openpatch.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/openpatch.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** openpatch.c 14 Nov 2005 21:44:23 -0000 1.4 --- openpatch.c 24 Sep 2006 22:58:10 -0000 1.5 *************** *** 10,14 **** #include <sys/stat.h> #include <stdio.h> ! #ifndef NT #include <unistd.h> #endif --- 10,14 ---- #include <sys/stat.h> #include <stdio.h> ! #ifndef _WIN32 #include <unistd.h> #endif
Index: ftos.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/ftos.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ftos.c 14 Nov 2005 21:44:23 -0000 1.3 --- ftos.c 24 Sep 2006 22:58:10 -0000 1.4 *************** *** 3,7 **** #include <sys/stat.h> #include <stdio.h> ! #ifndef NT #include <unistd.h> #endif --- 3,7 ---- #include <sys/stat.h> #include <stdio.h> ! #ifndef _WIN32 #include <unistd.h> #endif
Index: piperead~.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/piperead~.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** piperead~.c 2 Dec 2005 05:00:59 -0000 1.5 --- piperead~.c 24 Sep 2006 22:58:10 -0000 1.6 *************** *** 15,19 **** /* ------------------------ piperead_tilde~ ----------------------------- */
! #ifdef NT #define BINREADMODE "rb" #else --- 15,19 ---- /* ------------------------ piperead_tilde~ ----------------------------- */
! #ifdef _WIN32 #define BINREADMODE "rb" #else
Index: wavinfo.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/wavinfo.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wavinfo.c 23 Aug 2004 03:48:55 -0000 1.4 --- wavinfo.c 24 Sep 2006 22:58:10 -0000 1.5 *************** *** 10,14 **** #include <string.h> #include <fcntl.h> ! #ifndef NT #include <sys/mman.h> #endif --- 10,14 ---- #include <string.h> #include <fcntl.h> ! #ifndef _WIN32 #include <sys/mman.h> #endif
Index: scramble~.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/scramble~.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** scramble~.c 9 Mar 2003 11:10:53 -0000 1.2 --- scramble~.c 24 Sep 2006 22:58:10 -0000 1.3 *************** *** 3,7 **** #include <sys/types.h> #include <string.h> ! #ifndef NT #include <netinet/in.h> #include <netdb.h> --- 3,7 ---- #include <sys/types.h> #include <string.h> ! #ifndef _WIN32 #include <netinet/in.h> #include <netdb.h> *************** *** 112,116 **** int n; t_float val, valL, valR, killval; ! #ifndef NT t_float* out[x->x_channels]; t_float* in[x->x_channels]; --- 112,116 ---- int n; t_float val, valL, valR, killval; ! #ifndef _WIN32 t_float* out[x->x_channels]; t_float* in[x->x_channels]; *************** *** 449,453 **** }/*end if play */ }/*end while n-- */ ! #ifdef NT free(in); free(out); --- 449,453 ---- }/*end if play */ }/*end while n-- */ ! #ifdef _WIN32 free(in); free(out);
Index: streamout13~.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/streamout13~.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** streamout13~.c 2 Dec 2005 03:16:55 -0000 1.7 --- streamout13~.c 24 Sep 2006 22:58:10 -0000 1.8 *************** *** 4,8 **** #include <sys/types.h> #include <string.h> ! #if defined(UNIX) || defined(unix) #include <sys/errno.h> #include <sys/socket.h> --- 4,10 ---- #include <sys/types.h> #include <string.h> ! #ifdef _WIN32 ! #include <winsock.h> ! #else #include <sys/errno.h> #include <sys/socket.h> *************** *** 10,15 **** #include <netdb.h> #define SOCKET_ERROR -1 - #else - #include <winsock.h> #endif
--- 12,15 ---- *************** *** 29,37 **** static void sys_sockerror(char *s) { ! #if defined(UNIX) || defined(unix) ! int err = errno; ! #else int err = WSAGetLastError(); if (err == 10054) return; #endif post("%s: %s (%d)\n", s, strerror(err), err); --- 29,37 ---- static void sys_sockerror(char *s) { ! #ifdef _WIN32 int err = WSAGetLastError(); if (err == 10054) return; + #else + int err = errno; #endif post("%s: %s (%d)\n", s, strerror(err), err); *************** *** 42,50 **** static void sys_closesocket(int fd) { ! #if defined(UNIX) || defined(unix) ! close(fd); ! #endif ! #ifdef NT closesocket(fd); #endif } --- 42,49 ---- static void sys_closesocket(int fd) { ! #ifdef _WIN32 closesocket(fd); + #else + close(fd); #endif } *************** *** 163,167 **** short* cibuf; char* bp; ! #ifndef NT t_float *in[x->x_n]; #else --- 162,166 ---- short* cibuf; char* bp; ! #ifndef _WIN32 t_float *in[x->x_n]; #else *************** *** 270,274 **** } // post ("b-s-s:%d, length:%d, last:%d, prev:%d",x->blockssincesend,length,*cibuf,prev); ! #ifdef NT free(in); #endif --- 269,273 ---- } // post ("b-s-s:%d, length:%d, last:%d, prev:%d",x->blockssincesend,length,*cibuf,prev); ! #ifdef _WIN32 free(in); #endif
Index: sfwrite13~.c =================================================================== RCS file: /cvsroot/pure-data/externals/ext13/sfwrite13~.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sfwrite13~.c 14 Nov 2005 21:44:23 -0000 1.5 --- sfwrite13~.c 24 Sep 2006 22:58:10 -0000 1.6 *************** *** 12,16 **** #include <stdio.h> #include <string.h> ! #ifndef NT #include <unistd.h> #include <sys/mman.h> --- 12,16 ---- #include <stdio.h> #include <string.h> ! #ifndef _WIN32 #include <unistd.h> #include <sys/mman.h> *************** *** 22,26 ****
! #ifdef NT #define BINREADMODE "rb" #define OPENPARAMS O_WRONLY | O_CREAT | O_TRUNC --- 22,26 ----
! #ifdef _WIN32 #define BINREADMODE "rb" #define OPENPARAMS O_WRONLY | O_CREAT | O_TRUNC