FAUST compiler  0.9.9.6b8
compatibility.hh
Go to the documentation of this file.
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 #ifdef WIN32
28 #if !defined(INT) & !defined(FLOAT)
29 #include <windows.h>
30 #else
31 #include <io.h>
32 #endif
33 #include <time.h>
34 #include <assert.h>
35 
36 #undef min
37 #undef max
38 
39 #define int64_t __int64
40 #define YY_NO_UNISTD_H 1
41 
42 struct timezone
43 {
44  int tz_minuteswest; /* minutes W of Greenwich */
45  int tz_dsttime; /* type of dst correction */
46 };
47 
48 #define alarm(x)
49 #define strdup _strdup
50 #define isatty _isatty
51 #define fileno _fileno
52 #define snprintf _snprintf
53 double rint(double nr);
54 int gettimeofday(struct timeval *tv, struct timezone *tz);
55 bool chdir(const char* path);
56 int mkdir(const char* path, unsigned int attribute);
57 char* getcwd(char* str, unsigned int size);
58 int isatty(int file);
59 void getFaustPathname(char* str, unsigned int size);
60 void getFaustPathname(char* str, unsigned int size);
61 
62 #ifdef NDEBUG
63 #undef assert
64 #define assert(_Expression) do { bool bTest = (_Expression) != 0; } while (0)
65 #endif
66 
67 #define snprintf _snprintf
68 //#define rintf(x) floor((x)+(((x) < 0 ) ? -0.5f :0.5f))
69 #define FAUST_PATH_MAX 1024
70 
71 #if !defined(__MINGW32__)
72  double remainder(double numerator, double denominator);
73  #define S_IRWXU 0
74 #endif
75 
76 #define S_IRWXG 0
77 #define S_IROTH 0
78 #define S_IXOTH 0
79 #define DIRSEP '\\'
80 
81 #else
82 
83 #include <unistd.h>
84 #define DIRSEP '/'
85 #define FAUST_PATH_MAX 1024
86 
87 void getFaustPathname(char* str, unsigned int size);
88 
89 #endif
90 
91 #endif
void getFaustPathname(char *str, unsigned int size)