mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Get DirectSound and WinMM backends compiling with Cosmopolitan.
Note that this does not currently work at runtime.
This commit is contained in:
@@ -14,22 +14,28 @@ eliminate all of the content in this file.
|
||||
|
||||
#define WINAPI
|
||||
#define STDMETHODCALLTYPE
|
||||
#define CALLBACK
|
||||
|
||||
typedef uint64_t HWND;
|
||||
typedef uint64_t HANDLE;
|
||||
typedef uint64_t HKEY;
|
||||
typedef uint64_t HWAVEIN;
|
||||
typedef uint64_t HWAVEOUT;
|
||||
typedef uint32_t HRESULT;
|
||||
typedef uint8_t BYTE;
|
||||
typedef uint16_t WORD;
|
||||
typedef uint32_t DWORD;
|
||||
typedef uint64_t DWORDLONG;
|
||||
typedef int32_t BOOL;
|
||||
typedef int32_t LONG; /* `long` is always 32-bit on Windows. */
|
||||
typedef int32_t LONG; /* `long` is always 32-bit on Windows. */
|
||||
typedef int64_t LONGLONG;
|
||||
typedef uint32_t ULONG; /* `long` is always 32-bit on Windows. */
|
||||
typedef uint32_t ULONG; /* `long` is always 32-bit on Windows. */
|
||||
typedef uint64_t ULONGLONG;
|
||||
typedef char16_t WCHAR;
|
||||
typedef unsigned int UINT;
|
||||
typedef char CHAR;
|
||||
typedef uint64_t ULONG_PTR; /* Everything is 64-bit with Cosmopolitan. */
|
||||
typedef ULONG_PTR DWORD_PTR;
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
@@ -80,6 +86,72 @@ typedef struct
|
||||
|
||||
typedef int64_t LARGE_INTEGER;
|
||||
|
||||
|
||||
|
||||
#define HKEY_LOCAL_MACHINE ((HKEY)(ULONG_PTR)(0x80000002))
|
||||
#define KEY_READ 0x00020019
|
||||
|
||||
|
||||
#define MMSYSERR_NOERROR 0
|
||||
#define MMSYSERR_ERROR 1
|
||||
#define MMSYSERR_BADDEVICEID 2
|
||||
#define MMSYSERR_INVALHANDLE 5
|
||||
#define MMSYSERR_NOMEM 7
|
||||
#define MMSYSERR_INVALFLAG 10
|
||||
#define MMSYSERR_INVALPARAM 11
|
||||
#define MMSYSERR_HANDLEBUSY 12
|
||||
|
||||
#define CALLBACK_EVENT 0x00050000
|
||||
#define WAVE_ALLOWSYNC 0x0002
|
||||
|
||||
#define WHDR_DONE 0x00000001
|
||||
#define WHDR_PREPARED 0x00000002
|
||||
#define WHDR_BEGINLOOP 0x00000004
|
||||
#define WHDR_ENDLOOP 0x00000008
|
||||
#define WHDR_INQUEUE 0x00000010
|
||||
|
||||
#define MAXPNAMELEN 32
|
||||
|
||||
typedef UINT MMRESULT;
|
||||
typedef UINT MMVERSION;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
WORD wMid;
|
||||
WORD wPid;
|
||||
MMVERSION vDriverVersion;
|
||||
CHAR szPname[MAXPNAMELEN];
|
||||
DWORD dwFormats;
|
||||
WORD wChannels;
|
||||
WORD wReserved1;
|
||||
} WAVEINCAPSA;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
WORD wMid;
|
||||
WORD wPid;
|
||||
MMVERSION vDriverVersion;
|
||||
CHAR szPname[MAXPNAMELEN];
|
||||
DWORD dwFormats;
|
||||
WORD wChannels;
|
||||
WORD wReserved1;
|
||||
DWORD dwSupport;
|
||||
} WAVEOUTCAPSA;
|
||||
|
||||
typedef struct tagWAVEHDR
|
||||
{
|
||||
char* lpData;
|
||||
DWORD dwBufferLength;
|
||||
DWORD dwBytesRecorded;
|
||||
DWORD_PTR dwUser;
|
||||
DWORD dwFlags;
|
||||
DWORD dwLoops;
|
||||
struct tagWAVEHDR* lpNext;
|
||||
DWORD_PTR reserved;
|
||||
} WAVEHDR;
|
||||
|
||||
|
||||
|
||||
static HANDLE CreateEventA(struct NtSecurityAttributes* lpEventAttributes, bool32 bManualReset, bool32 bInitialState, const char* lpName)
|
||||
{
|
||||
assert(lpName == NULL); /* If this is ever triggered we'll need to do a ANSI-to-Unicode conversion. */
|
||||
|
||||
Reference in New Issue
Block a user