1 /*----------------------------------------------------------------------------
2 ChucK Concurrent, On-the-fly Audio Programming Language
3 Compiler and Virtual Machine
5 Copyright (c) 2004 Ge Wang and Perry R. Cook. All rights reserved.
6 http://chuck.cs.princeton.edu/
7 http://soundlab.cs.princeton.edu/
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 -----------------------------------------------------------------------------*/
25 //-----------------------------------------------------------------------------
29 // author: Ge Wang (gewang@cs.princeton.edu)
30 // Perry R. Cook (prc@cs.princeton.edu)
32 //-----------------------------------------------------------------------------
33 #ifndef __CHUCK_DEF_H__
34 #define __CHUCK_DEF_H__
41 #define t_CKTIME double
42 #define t_CKDUR double
43 #define t_CKFLOAT double
44 #define t_CKDOUBLE double
45 #define t_CKSINGLE float
47 #define t_CKDWORD unsigned long
48 #define t_CKUINT t_CKDWORD
49 #define t_CKBOOL t_CKDWORD
50 #define t_CKBYTE unsigned char
53 typedef const char * c_constr
;
56 #define SAMPLE_FLOAT float
57 #define SAMPLE SAMPLE_FLOAT
66 #define SAFE_DELETE(x) { if(x){ delete x; x = NULL; } }
67 #define SAFE_DELETE_ARRAY(x) { if(x){ delete [] x; x = NULL; } }
70 #ifdef __MACOSX_CORE__
71 #define __PLATFORM_MACOSX__
74 #if defined(__LINUX_ALSA__) || defined(__LINUX_JACK__) || defined(__LINUX_OSS__)
75 #define __PLATFORM_LINUX__
78 #ifdef __PLATFORM_WIN32__
79 #define usleep(x) Sleep( (x / 1000 <= 0 ? 1 : x / 1000) )
80 #pragma warning (disable : 4996) //stdio deprecation
81 #pragma warning (disable : 4312) //type casts from void*
82 #pragma warning (disable : 4311) //type casts to void*
83 #pragma warning (disable : 4244) //truncation