Update libretro-common files

This commit is contained in:
retro-wertz
2017-08-29 19:16:37 +08:00
parent 8c163bf0ed
commit b26b68244f
3 changed files with 12 additions and 6 deletions

View File

@@ -30,7 +30,7 @@
/* http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 */ /* http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 */
int vsnprintf(char *outBuf, size_t size, const char *format, va_list ap) int c99_vsnprintf_retro__(char *outBuf, size_t size, const char *format, va_list ap)
{ {
int count = -1; int count = -1;
@@ -46,7 +46,7 @@ int vsnprintf(char *outBuf, size_t size, const char *format, va_list ap)
return count; return count;
} }
int snprintf(char *outBuf, size_t size, const char *format, ...) int c99_snprintf_retro__(char *outBuf, size_t size, const char *format, ...)
{ {
int count; int count;
va_list ap; va_list ap;

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2010-2015 The RetroArch team /* Copyright (C) 2010-2017 The RetroArch team
* *
* --------------------------------------------------------------------------------------- * ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (memory_stream.h). * The following license statement only applies to this file (memory_stream.h).
@@ -26,6 +26,10 @@
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include <retro_common_api.h>
RETRO_BEGIN_DECLS
typedef struct memstream memstream_t; typedef struct memstream memstream_t;
memstream_t *memstream_open(unsigned writing); memstream_t *memstream_open(unsigned writing);
@@ -52,4 +56,6 @@ void memstream_set_buffer(uint8_t *buffer, size_t size);
size_t memstream_get_last_size(void); size_t memstream_get_last_size(void);
RETRO_END_DECLS
#endif #endif

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2010-2016 The RetroArch team /* Copyright (C) 2010-2017 The RetroArch team
* *
* --------------------------------------------------------------------------------------- * ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (memory_stream.c). * The following license statement only applies to this file (memory_stream.c).
@@ -24,7 +24,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "../include/streams/memory_stream.h" #include <streams/memory_stream.h>
static uint8_t* g_buffer = NULL; static uint8_t* g_buffer = NULL;
static size_t g_size = 0; static size_t g_size = 0;
@@ -41,7 +41,7 @@ struct memstream
static void memstream_update_pos(memstream_t *stream) static void memstream_update_pos(memstream_t *stream)
{ {
if (stream->ptr > stream->max_ptr) if (stream && stream->ptr > stream->max_ptr)
stream->max_ptr = stream->ptr; stream->max_ptr = stream->ptr;
} }