*** empty log message ***
[chuck-blob.git] / v1 / chuck_def.h
blobfa2703cc6c423fe132f1fa53995de76703ca39f4
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
22 U.S.A.
23 -----------------------------------------------------------------------------*/
25 //-----------------------------------------------------------------------------
26 // file: chuck_def.h
27 // desc: ...
29 // author: Ge Wang (gewang@cs.princeton.edu)
30 // Perry R. Cook (prc@cs.princeton.edu)
31 // date: Autumn 2002
32 //-----------------------------------------------------------------------------
33 #ifndef __CHUCK_DEF_H__
34 #define __CHUCK_DEF_H__
36 #include <stdlib.h>
37 #include <memory.h>
40 // types
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
46 #define t_CKINT long
47 #define t_CKDWORD unsigned long
48 #define t_CKUINT t_CKDWORD
49 #define t_CKBOOL t_CKDWORD
50 #define t_CKBYTE unsigned char
52 typedef char * c_str;
53 typedef const char * c_constr;
55 // sample
56 #define SAMPLE_FLOAT float
57 #define SAMPLE SAMPLE_FLOAT
59 // bool
60 #ifndef TRUE
61 #define TRUE 1
62 #define FALSE 0
63 #endif
65 #ifndef SAFE_DELETE
66 #define SAFE_DELETE(x) { if(x){ delete x; x = NULL; } }
67 #define SAFE_DELETE_ARRAY(x) { if(x){ delete [] x; x = NULL; } }
68 #endif
70 #ifdef __MACOSX_CORE__
71 #define __PLATFORM_MACOSX__
72 #endif
74 #if defined(__LINUX_ALSA__) || defined(__LINUX_JACK__) || defined(__LINUX_OSS__)
75 #define __PLATFORM_LINUX__
76 #endif
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
84 #endif
87 #endif