-
Notifications
You must be signed in to change notification settings - Fork 26
/
osspecific.h
54 lines (42 loc) · 1.49 KB
/
osspecific.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Copyright (C) 2016 - 2024 Judd Niemann - All Rights Reserved.
* You may use, distribute and modify this code under the
* terms of the GNU Lesser General Public License, version 2.1
*
* You should have received a copy of GNU Lesser General Public License v2.1
* with this file. If not, please refer to: https://github.com/jniemann66/ReSampler
*/
#ifndef OSSPECIFIC_H
#define OSSPECIFIC_H 1
// macros which address differences between compilers / operating systems go here.
#ifdef _WIN32
/* begin Windows-specific */
#if defined(_MSC_VER)
/* MSVC */
#define NOMINMAX // disable min() and max() macros (use std:: library instead)
#pragma warning(disable : 4996) // suppress pointless MS "deprecation" warnings
#pragma warning(disable : 4244) // suppress double-to-float warnings
#define BYTESWAP_METHOD_MSVCRT
#else
/* Not MSVC */
#define BYTESWAP_METHOD_BUILTIN // note : gcc >= 4.8.1 , clang >= 3.5
#endif
#define TEMPFILE_OPEN_METHOD_WINAPI
// Note: tmpfile() doesn't seem to work reliably with MSVC - probably related to this:
// http://www.mega-nerd.com/libsndfile/api.html#open_fd (see note regarding differing versions of MSVC runtime DLL)
#ifndef UNICODE
#define UNICODE // turns TCHAR into wchar_t
#endif
#include <Windows.h>
#include <codecvt>
/* end Windows-Specific*/
#else
/* begin Non-Windows */
#include <cstdint>
typedef uint64_t __int64;
#define stricmp strcasecmp
#define TEMPFILE_OPEN_METHOD_STD_TMPFILE
#define BYTESWAP_METHOD_BUILTIN
/* end non-Windows */
#endif
#endif // OSSPECIFIC_H