Completing basic operations in basic.ml for primitives float, And, Or, Xor, fmod...
[Faustine.git] / interpretor / preprocessor / faust-0.9.47mr3 / compiler / tlib / compatibility.hh
1 /************************************************************************
2 ************************************************************************
3 FAUST compiler
4 Copyright (C) 2003-2004 GRAME, Centre National de Creation Musicale
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., 675 Mass Ave, Cambridge, MA 02139, USA.
19 ************************************************************************
20 ************************************************************************/
21
22
23 #ifndef __COMPATIBILITY__
24 #define __COMPATIBILITY__
25
26
27 #if defined (WIN32)
28
29 #include <windows.h>
30
31 #ifdef WIN32
32 #undef min
33 #undef max
34 #endif
35
36 bool chdir(const char* path);
37 int mkdir(const char* path, unsigned int attribute);
38 char* getcwd(char* str, unsigned int size);
39 int isatty(int file);
40 void getFaustPathname(char* str, unsigned int size);
41 void getFaustPathname(char* str, unsigned int size);
42
43 #include <assert.h>
44 #ifdef NDEBUG
45 #undef assert
46 #define assert(_Expression) do { bool bTest = (_Expression) != 0; } while (0)
47 #endif
48
49 #define snprintf _snprintf
50 //#define rintf(x) floor((x)+(((x) < 0 ) ? -0.5f :0.5f))
51 #define FAUST_PATH_MAX 1024
52
53 #if !defined(__MINGW32__)
54 double remainder(double numerator, double denominator);
55 #define S_IRWXU 0
56 #endif
57
58 #define S_IRWXG 0
59 #define S_IROTH 0
60 #define S_IXOTH 0
61 #define DIRSEP '\\'
62
63 #else
64
65 #include <unistd.h>
66 #define DIRSEP '/'
67 #define FAUST_PATH_MAX 1024
68
69 void getFaustPathname(char* str, unsigned int size);
70
71 #endif
72
73 #endif