2 |
* * |
* * |
3 |
* libgig - C++ cross-platform Gigasampler format file access library * |
* libgig - C++ cross-platform Gigasampler format file access library * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003-2021 by Christian Schoenebeck * |
* Copyright (C) 2003-2024 by Christian Schoenebeck * |
6 |
* <cuse@users.sourceforge.net> * |
* <cuse@users.sourceforge.net> * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library is free software; you can redistribute it and/or modify * |
24 |
#ifndef __RIFF_H__ |
#ifndef __RIFF_H__ |
25 |
#define __RIFF_H__ |
#define __RIFF_H__ |
26 |
|
|
|
#ifdef WIN32 |
|
|
# define POSIX 0 |
|
|
#endif |
|
|
|
|
|
#ifndef POSIX |
|
|
# define POSIX 1 |
|
|
#endif |
|
|
|
|
|
#ifndef DEBUG |
|
|
# define DEBUG 0 |
|
|
#endif |
|
|
|
|
|
#ifndef OVERRIDE |
|
|
# if defined(__cplusplus) && __cplusplus >= 201103L |
|
|
# define OVERRIDE override |
|
|
# else |
|
|
# define OVERRIDE |
|
|
# endif |
|
|
#endif |
|
|
|
|
|
#ifdef __GNUC__ |
|
|
# define LIBGIG_DEPRECATED_API(msg) __attribute__ ((deprecated(msg))) |
|
|
#else |
|
|
# define LIBGIG_DEPRECATED_API(msg) |
|
|
#endif |
|
|
|
|
27 |
#include <string> |
#include <string> |
28 |
#include <list> |
#include <list> |
29 |
#include <map> |
#include <map> |
33 |
#include <stdarg.h> |
#include <stdarg.h> |
34 |
#include <thread> |
#include <thread> |
35 |
#include <mutex> |
#include <mutex> |
|
|
|
|
#ifdef HAVE_CONFIG_H |
|
|
# include <config.h> |
|
|
#endif |
|
|
|
|
|
#if POSIX |
|
|
# include <sys/types.h> |
|
|
# include <sys/stat.h> |
|
|
# include <fcntl.h> |
|
|
# include <unistd.h> |
|
|
#endif // POSIX |
|
|
|
|
|
#if defined _MSC_VER && _MSC_VER < 1600 |
|
|
// Visual C++ 2008 doesn't have stdint.h |
|
|
typedef __int8 int8_t; |
|
|
typedef __int16 int16_t; |
|
|
typedef __int32 int32_t; |
|
|
typedef __int64 int64_t; |
|
|
typedef unsigned __int8 uint8_t; |
|
|
typedef unsigned __int16 uint16_t; |
|
|
typedef unsigned __int32 uint32_t; |
|
|
typedef unsigned __int64 uint64_t; |
|
|
#else |
|
|
#include <stdint.h> |
|
|
#endif |
|
|
|
|
|
#ifdef WIN32 |
|
|
# if (_WIN32 && !_WIN64) || (__GNUC__ && !(__x86_64__ || __ppc64__)) /* if 32 bit windows compilation */ |
|
|
# if _WIN32_WINNT < 0x0501 |
|
|
# undef _WIN32_WINNT |
|
|
# define _WIN32_WINNT 0x0501 /* Win XP (no service pack): required for 32 bit compilation for GetFileSizeEx() to be declared by windows.h */ |
|
|
# endif |
|
|
# endif |
|
|
# include <windows.h> |
|
|
typedef unsigned int uint; |
|
|
#endif // WIN32 |
|
|
|
|
36 |
#include <stdio.h> |
#include <stdio.h> |
37 |
|
|
38 |
|
#include "sysdef.h" |
39 |
|
|
40 |
#if WORDS_BIGENDIAN |
#if WORDS_BIGENDIAN |
41 |
# define CHUNK_ID_RIFF 0x52494646 |
# define CHUNK_ID_RIFF 0x52494646 |
42 |
# define CHUNK_ID_RIFX 0x52494658 |
# define CHUNK_ID_RIFX 0x52494658 |