Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24283
Modified Files: Tag: devel_0_39 s_inter.c Log Message: add places to look for wish on OSX (for standalone app); #ifdef changes MSW to _WIN32
Index: s_inter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v retrieving revision 1.5.4.10.2.16 retrieving revision 1.5.4.10.2.17 diff -C2 -d -r1.5.4.10.2.16 -r1.5.4.10.2.17 *** s_inter.c 26 Jul 2006 10:17:27 -0000 1.5.4.10.2.16 --- s_inter.c 28 Jul 2006 14:40:27 -0000 1.5.4.10.2.17 *************** *** 12,16 **** #include "m_imp.h" #include "g_canvas.h" /* for GUI queueing stuff */ ! #ifndef MSW #include <unistd.h> #include <sys/socket.h> --- 12,16 ---- #include "m_imp.h" #include "g_canvas.h" /* for GUI queueing stuff */ ! #ifndef _WIN32 #include <unistd.h> #include <sys/socket.h> *************** *** 26,30 **** #include <bstring.h> #endif ! #ifdef MSW #include <io.h> #include <fcntl.h> --- 26,30 ---- #include <bstring.h> #endif ! #ifdef _WIN32 #include <io.h> #include <fcntl.h> *************** *** 32,39 **** --- 32,42 ---- #include <winsock.h> #include <windows.h> + # ifdef _MSC_VER typedef int pid_t; + # endif typedef int socklen_t; #define EADDRINUSE WSAEADDRINUSE #endif + #include <stdarg.h> #include <signal.h> *************** *** 104,108 **** /* ----------- functions for timing, signals, priorities, etc --------- */
! #ifdef MSW static LARGE_INTEGER nt_inittime; static double nt_freq = 0; --- 107,111 ---- /* ----------- functions for timing, signals, priorities, etc --------- */
! #ifdef _WIN32 static LARGE_INTEGER nt_inittime; static double nt_freq = 0; *************** *** 133,137 **** } #endif ! #endif /* MSW */
/* get "real time" in seconds; take the --- 136,140 ---- } #endif ! #endif /* _WIN32 */
/* get "real time" in seconds; take the *************** *** 139,143 **** double sys_getrealtime(void) { ! #ifndef MSW static struct timeval then; struct timeval now; --- 142,146 ---- double sys_getrealtime(void) { ! #ifndef _WIN32 static struct timeval then; struct timeval now; *************** *** 354,358 **** else par.sched_priority = 192; /* priority for pd (DSP) */ - if (sched_setscheduler(0, SCHED_FIFO, &par) != -1) fprintf(stderr, "priority %d scheduling enabled.\n", par.sched_priority); --- 357,360 ---- *************** *** 371,375 **** void sys_sockerror(char *s) { ! #ifdef MSW int err = WSAGetLastError(); if (err == 10054) return; --- 373,377 ---- void sys_sockerror(char *s) { ! #ifdef _WIN32 int err = WSAGetLastError(); if (err == 10054) return; *************** *** 382,386 **** #else int err = errno; ! #endif fprintf(stderr, "%s: %s (%d)\n", s, strerror(err), err); } --- 384,388 ---- #else int err = errno; ! #endif /* _WIN32 */ fprintf(stderr, "%s: %s (%d)\n", s, strerror(err), err); } *************** *** 585,591 **** close(fd); #endif ! #ifdef MSW closesocket(fd); ! #endif }
--- 587,593 ---- close(fd); #endif ! #ifdef _WIN32 closesocket(fd); ! #endif /* _WIN32 */ }
*************** *** 921,928 **** int ntry = 0, portno = FIRSTPORTNUM; int xsock = -1; ! #ifdef MSW short version = MAKEWORD(2, 0); WSADATA nobby; ! #endif #ifdef UNISTD int stdinpipe[2]; --- 923,930 ---- int ntry = 0, portno = FIRSTPORTNUM; int xsock = -1; ! #ifdef _WIN32 short version = MAKEWORD(2, 0); WSADATA nobby; ! #endif /* _WIN32 */ #ifdef UNISTD int stdinpipe[2]; *************** *** 950,956 **** #endif #endif ! #ifdef MSW if (WSAStartup(version, &nobby)) sys_sockerror("WSAstartup"); ! #endif
if (sys_nogui) --- 952,958 ---- #endif #endif ! #ifdef _WIN32 if (WSAStartup(version, &nobby)) sys_sockerror("WSAstartup"); ! #endif /* _WIN32 */
if (sys_nogui) *************** *** 1026,1032 **** if (setsockopt(xsock, IPPROTO_TCP, TCP_NODELAY, &intarg, sizeof(intarg)) < 0) ! #ifndef MSW post("setsockopt (TCP_NODELAY) failed\n") ! #endif ;
--- 1028,1034 ---- if (setsockopt(xsock, IPPROTO_TCP, TCP_NODELAY, &intarg, sizeof(intarg)) < 0) ! #ifndef _WIN32 post("setsockopt (TCP_NODELAY) failed\n") ! #endif /* not _WIN32 */ ;
*************** *** 1041,1049 **** while (bind(xsock, (struct sockaddr *)&server, sizeof(server)) < 0) { ! #ifdef MSW int err = WSAGetLastError(); #else int err = errno; ! #endif if ((ntry++ > 20) || (err != EADDRINUSE)) { --- 1043,1051 ---- while (bind(xsock, (struct sockaddr *)&server, sizeof(server)) < 0) { ! #ifdef _WIN32 int err = WSAGetLastError(); #else int err = errno; ! #endif /* _WIN32 */ if ((ntry++ > 20) || (err != EADDRINUSE)) { *************** *** 1095,1099 **** char *homedir = getenv("HOME"), filename[250]; struct stat statbuf; ! /* first look for Wish bundled with and renamed "Pd" */ sprintf(filename, "%s/../../MacOS/Pd", guidir); if (stat(filename, &statbuf) >= 0) --- 1097,1108 ---- char *homedir = getenv("HOME"), filename[250]; struct stat statbuf; ! /* First look for wish (renamed "Pd") in bundled tk.framework */ ! sprintf(filename, "%s/../Frameworks/Tk.framework/Resources/Pd", guidir); ! if (stat(filename, &statbuf) >= 0) ! goto foundit; ! sprintf(filename, "%s/../Frameworks/Pd", guidir); ! if (stat(filename, &statbuf) >= 0) ! goto foundit; ! /* also look for standalone Wish bundled with and renamed "Pd" */ sprintf(filename, "%s/../../MacOS/Pd", guidir); if (stat(filename, &statbuf) >= 0) *************** *** 1149,1154 **** --- 1158,1167 ---- "/Applications/Wish.app/Contents/MacOS/Wish"); foundit: + #ifndef DESIRE sprintf(cmdbuf, ""%s" %s/pd.tk %d\n", filename, guidir, portno); #else + sprintf(cmdbuf, ""%s" %s/desire.tk %d\n", filename, guidir, portno); + #endif + #else sprintf(cmdbuf, "TCL_LIBRARY="%s/tcl/library" TK_LIBRARY="%s/tk/library" \ *************** *** 1165,1170 **** #endif /* UNISTD */
! #ifdef MSW ! /* in MSW land "guipath" is unused; we just do everything from the libdir. */ /* fprintf(stderr, "%s\n", sys_libdir->s_name); */ --- 1178,1183 ---- #endif /* UNISTD */
! #ifdef _WIN32 ! /* in WIN32 land "guipath" is unused; we just do everything from the libdir. */ /* fprintf(stderr, "%s\n", sys_libdir->s_name); */