mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 04:44:02 +00:00
Fixup compatibility.
This commit is contained in:
parent
ceee10b56c
commit
18f407110b
@ -4,13 +4,18 @@
|
||||
License: Public Domain
|
||||
*/
|
||||
|
||||
#include "xaudio-c.h"
|
||||
#include "xaudio.h"
|
||||
#include "xaudio-c.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#define MAX_BUFFERS 16
|
||||
#define MAX_BUFFERS_MASK (MAX_BUFFERS - 1)
|
||||
|
||||
#undef min
|
||||
#undef max
|
||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
struct xaudio2
|
||||
{
|
||||
const IXAudio2VoiceCallbackVtbl *lpVtbl;
|
||||
|
@ -16,13 +16,18 @@
|
||||
*/
|
||||
|
||||
#include "posix_string.h"
|
||||
|
||||
#undef strcasecmp
|
||||
#undef strdup
|
||||
#undef isblank
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include "strl.h"
|
||||
|
||||
int strcasecmp(const char *a, const char *b)
|
||||
#include <string.h>
|
||||
|
||||
int strcasecmp_ssnes__(const char *a, const char *b)
|
||||
{
|
||||
while (*a && *b)
|
||||
{
|
||||
@ -38,7 +43,7 @@ int strcasecmp(const char *a, const char *b)
|
||||
return tolower(*a) - tolower(*b);
|
||||
}
|
||||
|
||||
char *strdup(const char *orig)
|
||||
char *strdup_ssnes__(const char *orig)
|
||||
{
|
||||
size_t len = strlen(orig) + 1;
|
||||
char *ret = (char*)malloc(len);
|
||||
@ -49,7 +54,7 @@ char *strdup(const char *orig)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int isblank(int c)
|
||||
int isblank_ssnes__(int c)
|
||||
{
|
||||
return (c == ' ') || (c == '\t');
|
||||
}
|
||||
|
@ -19,14 +19,18 @@
|
||||
#define __SSNES_POSIX_STRING_H
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#define strcasecmp(a, b) strcasecmp_ssnes__(a, b)
|
||||
#define strdup(orig) strdup_ssnes__(orig)
|
||||
#define isblank(c) isblank_ssnes__(c)
|
||||
int strcasecmp(const char *a, const char *b);
|
||||
char *strdup(const char *orig);
|
||||
int isblank(int c);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
10
strl.h
10
strl.h
@ -26,13 +26,19 @@
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRL
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
// Avoid possible naming collitions during link since we prefer to use the actual name.
|
||||
#define strlcpy(dst, src, size) strlcpy_ssnes__(dst, src, size)
|
||||
#define strlcat(dst, src, size) strlcat_ssnes__(dst, src, size)
|
||||
|
||||
size_t strlcpy(char *dest, const char *source, size_t size);
|
||||
size_t strlcat(char *dest, const char *source, size_t size);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user