/[svn]/linuxsampler/trunk/src/common/global.h
ViewVC logotype

Contents of /linuxsampler/trunk/src/common/global.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3707 - (show annotations) (download) (as text)
Wed Jan 8 21:21:58 2020 UTC (4 years, 3 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 3015 byte(s)
Fixed compiler warnings about format specifiers:

Use portable format specifiers like PRId64 from inttypes.h
instead of assuming a particular word size.

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 * Copyright (C) 2005 - 2020 Christian Schoenebeck *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21 * MA 02111-1307 USA *
22 ***************************************************************************/
23
24 // All application global declarations that HAVE to be exposed to the C++
25 // API are defined here.
26
27 #ifndef __LS_GLOBAL_H__
28 #define __LS_GLOBAL_H__
29
30 #include <stdlib.h>
31 #include <stdint.h>
32 #include <stdio.h>
33 #include <inttypes.h>
34
35 #include <string>
36
37 typedef std::string String;
38
39 #if defined(WIN32)
40 #include <windows.h>
41
42 // modern MinGW has usleep
43 #if (__MINGW32_MAJOR_VERSION < 3 || \
44 (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15)) && \
45 !defined(__MINGW64) && !defined(__MINGW64_VERSION_MAJOR)
46 #define usleep(a) Sleep(a/1000)
47 #endif
48
49 #define sleep(a) Sleep(a*1000)
50 typedef unsigned int uint;
51 // FIXME: define proper functions which do proper alignement under Win32
52 #define alignedMalloc(a,b) malloc(b)
53 #define alignedFree(a) free(a)
54 #else
55 // needed for usleep under POSIX
56 #include <stdio.h>
57 // for uint
58 #include <sys/types.h>
59 #endif
60
61 #ifdef __GNUC__
62 #define DEPRECATED_API __attribute__ ((deprecated))
63 #else
64 #define DEPRECATED_API
65 #endif
66
67 // whether compiler is C++11 standard compliant
68 #if defined(__cplusplus) && __cplusplus >= 201103L
69 # define IS_CPP11 1
70 #endif
71
72 // C++ "override" keyword introduced with C++11 standard
73 #if IS_CPP11
74 # define OVERRIDE override
75 # define FINAL final
76 #else
77 # define OVERRIDE
78 # define FINAL
79 #endif
80
81 #endif // __LS_GLOBAL_H__

  ViewVC Help
Powered by ViewVC