1 /* 2 SuperCollider real time audio synthesis system 3 Copyright (c) 2002 James McCartney. All rights reserved. 4 http://www.audiosynth.com 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2 of the License, or 9 (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 */ 20 21 #pragma once 22 23 #ifdef _WIN32 24 25 # ifdef IN 26 # define SC_IN IN 27 # undef IN 28 # endif 29 30 # ifdef OUT 31 # define SC_OUT OUT 32 # undef OUT 33 # endif SC_VersionString()34 35 # include <stdio.h> 36 # include <winsock2.h> 37 # undef IN 38 # undef OUT 39 # ifdef SC_IN 40 # define IN SC_IN 41 # endif 42 43 # ifdef SC_OUT 44 # define OUT SC_OUT 45 # endif 46 47 // wrappers for unix replacements 48 # define basename win32_basename 49 # define dirname win32_dirname 50 # define pipe win32_pipe 51 52 # if _MSC_VER 53 typedef int pid_t; 54 # define snprintf _snprintf 55 # endif 56 57 void win32_ReplaceCharInString(char* string, int len, char src, char dst); 58 // Finds the parent folder of a specified path pattern (including trailing slash) 59 void win32_ExtractContainingFolder(char* folder, const char* pattern, int maxChars); 60 void win32_GetKnownFolderPath(int folderId, char* dest, int size); 61 void win32_synctimes(); 62 char* win32_basename(char* path); 63 char* win32_dirname(char* path); 64 int win32_pipe(int handles[2]); 65 int win32_piperead(int s, char* buf, int len); 66 int win32_pipewrite(int s, char* buf, int len); 67 68 // alloca 69 # include <malloc.h> 70 # ifndef alloca // MinGW has alloca defined in malloc.h, MSVC not 71 # define alloca _alloca 72 # endif 73 74 #endif //_WIN32 75