3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 - 2007 Christian Schoenebeck * |
* Copyright (C) 2005 - 2020 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* 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 * |
* it under the terms of the GNU General Public License as published by * |
27 |
#ifndef __LS_GLOBAL_H__ |
#ifndef __LS_GLOBAL_H__ |
28 |
#define __LS_GLOBAL_H__ |
#define __LS_GLOBAL_H__ |
29 |
|
|
30 |
|
// workaround for a bug with older versions of mingw, which would prevent |
31 |
|
// portable format specifiers like PRId64 from being defined |
32 |
|
#ifdef __MINGW32__ |
33 |
|
# define __STDC_FORMAT_MACROS 1 |
34 |
|
#endif |
35 |
|
|
36 |
|
// C++ header <string> before any C headers intentionally here, due to |
37 |
|
// format specifiers bug occurring with older versions of mingw (see above) |
38 |
|
#include <string> |
39 |
#include <stdlib.h> |
#include <stdlib.h> |
40 |
#include <stdint.h> |
#include <stdint.h> |
41 |
#include <stdio.h> |
#include <stdio.h> |
42 |
|
#include <inttypes.h> |
|
#include <string> |
|
43 |
|
|
44 |
typedef std::string String; |
typedef std::string String; |
45 |
|
|
46 |
#if defined(WIN32) |
#if defined(WIN32) |
47 |
#include <windows.h> |
#include <windows.h> |
48 |
|
|
49 |
|
// modern MinGW has usleep |
50 |
|
#if (__MINGW32_MAJOR_VERSION < 3 || \ |
51 |
|
(__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 15)) && \ |
52 |
|
!defined(__MINGW64) && !defined(__MINGW64_VERSION_MAJOR) |
53 |
#define usleep(a) Sleep(a/1000) |
#define usleep(a) Sleep(a/1000) |
54 |
|
#endif |
55 |
|
|
56 |
#define sleep(a) Sleep(a*1000) |
#define sleep(a) Sleep(a*1000) |
57 |
typedef unsigned int uint; |
typedef unsigned int uint; |
58 |
// FIXME: define proper functions which do proper alignement under Win32 |
// FIXME: define proper functions which do proper alignement under Win32 |
65 |
#include <sys/types.h> |
#include <sys/types.h> |
66 |
#endif |
#endif |
67 |
|
|
68 |
|
#ifdef __GNUC__ |
69 |
|
#define DEPRECATED_API __attribute__ ((deprecated)) |
70 |
|
#else |
71 |
|
#define DEPRECATED_API |
72 |
|
#endif |
73 |
|
|
74 |
|
// whether compiler is C++11 standard compliant |
75 |
|
#if defined(__cplusplus) && __cplusplus >= 201103L |
76 |
|
# define IS_CPP11 1 |
77 |
|
#endif |
78 |
|
|
79 |
|
// C++ "override" keyword introduced with C++11 standard |
80 |
|
#if IS_CPP11 |
81 |
|
# define OVERRIDE override |
82 |
|
# define FINAL final |
83 |
|
#else |
84 |
|
# define OVERRIDE |
85 |
|
# define FINAL |
86 |
|
#endif |
87 |
|
|
88 |
#endif // __LS_GLOBAL_H__ |
#endif // __LS_GLOBAL_H__ |