Update libretro-common

This commit is contained in:
twinaphex 2018-04-19 08:20:02 +02:00
parent ea2d49b63d
commit f1a2f4369c
50 changed files with 121 additions and 66 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (compat_posix_string.c).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (compat_snprintf.c).
@ -24,8 +24,9 @@
#ifdef _MSC_VER
#include <retro_common.h>
#if _MSC_VER >= 1900
#include <stdio.h> /* added for _vsnprintf_s and _vscprintf on VS2015 and VS2017 */
#endif
#include <stdarg.h>
#if _MSC_VER < 1800

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (compat_strcasestr.c).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (compat_strl.c).

View File

@ -1,3 +1,25 @@
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (fopen_utf8.c).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <compat/fopen_utf8.h>
#include <encodings/utf.h>
#include <stdio.h>

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (encoding_utf.c).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro SDK code part (glsm).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro SDK code part (glsym).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro SDK code part (glsym).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (rhash.c).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (boolean.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (apple_compat.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (fnmatch.h).

View File

@ -1,8 +1,30 @@
#ifndef __FOPEN_UTF8_H
#define __FOPEN_UTF8_H
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (fopen_utf8.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __LIBRETRO_SDK_COMPAT_FOPEN_UTF8_H
#define __LIBRETRO_SDK_COMPAT_FOPEN_UTF8_H
#ifdef _WIN32
/* defined to error rather than fopen_utf8, to make it clear to everyone reading the code that not worrying about utf16 is fine */
/* Defined to error rather than fopen_utf8, to make it clear to everyone reading the code that not worrying about utf16 is fine */
/* TODO: enable */
/* #define fopen (use fopen_utf8 instead) */
void *fopen_utf8(const char * filename, const char * mode);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (getopt.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (intrinsics.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (msvc.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (posix_string.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (strcasestr.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (strl.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (utf.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro SDK code part (glsm.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro SDK code part (glsmsym.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro SDK code part (glsym).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro SDK code part (glsym).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro SDK code part (glsym).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro SDK code part (glsym).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro API header (libretro.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (float_minmax.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (memmap.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_common.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_common_api.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_dirent.h).
@ -32,6 +32,16 @@ RETRO_BEGIN_DECLS
typedef struct RDIR RDIR;
/**
*
* retro_opendir:
* @name : path to the directory to open.
*
* Opens a directory for reading. Tidy up with retro_closedir.
*
* Returns: RDIR pointer on success, NULL if name is not a
* valid directory, null itself or the empty string.
*/
struct RDIR *retro_opendir(const char *name);
int retro_readdir(struct RDIR *rdir);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_endianness.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_environment.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_inline.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_miscellaneous.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (rhash.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (rthreads.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (file_stream.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (file_stream_transforms.h).
@ -23,9 +23,10 @@
#ifndef __LIBRETRO_SDK_FILE_STREAM_TRANSFORMS_H
#define __LIBRETRO_SDK_FILE_STREAM_TRANSFORMS_H
#include <stdint.h>
#include <string.h>
#include <retro_common_api.h>
#include <streams/file_stream.h>
#include <string.h>
RETRO_BEGIN_DECLS
@ -61,19 +62,19 @@ RFILE* rfopen(const char *path, const char *mode);
int rfclose(RFILE* stream);
long rftell(RFILE* stream);
int64_t rftell(RFILE* stream);
int rfseek(RFILE* stream, long offset, int origin);
int64_t rfseek(RFILE* stream, int64_t offset, int origin);
size_t rfread(void* buffer,
size_t elementSize, size_t elementCount, RFILE* stream);
int64_t rfread(void* buffer,
size_t elem_size, size_t elem_count, RFILE* stream);
char *rfgets(char *buffer, int maxCount, RFILE* stream);
int rfgetc(RFILE* stream);
size_t rfwrite(void const* buffer,
size_t elementSize, size_t elementCount, RFILE* stream);
int64_t rfwrite(void const* buffer,
size_t elem_size, size_t elem_count, RFILE* stream);
int rfputc(int character, RFILE * stream);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (stdstring.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (vfs_implementation.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (gx_pthread.h).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (rthreads.c).
@ -57,8 +57,7 @@
#include <time.h>
#endif
#if defined(VITA) || defined(__FreeBSD__) || defined(__DragonFly__) || \
defined(__OpenBSD__) || defined(__NetBSD__)
#if defined(VITA) || defined(BSD)
#include <sys/time.h>
#endif

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (xenon_sdl_threads.c).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (file_stream.c).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (file_stream_transforms.c).
@ -72,12 +72,12 @@ int rfclose(RFILE* stream)
return filestream_close(stream);
}
long rftell(RFILE* stream)
int64_t rftell(RFILE* stream)
{
return filestream_tell(stream);
}
int rfseek(RFILE* stream, long offset, int origin)
int64_t rfseek(RFILE* stream, int64_t offset, int origin)
{
int seek_position = -1;
switch (origin)
@ -93,10 +93,10 @@ int rfseek(RFILE* stream, long offset, int origin)
break;
}
return (int)filestream_seek(stream, (ssize_t)offset, seek_position);
return filestream_seek(stream, offset, seek_position);
}
size_t rfread(void* buffer,
int64_t rfread(void* buffer,
size_t elem_size, size_t elem_count, RFILE* stream)
{
return filestream_read(stream, buffer, elem_size * elem_count);
@ -112,7 +112,7 @@ int rfgetc(RFILE* stream)
return filestream_getc(stream);
}
size_t rfwrite(void const* buffer,
int64_t rfwrite(void const* buffer,
size_t elem_size, size_t elem_count, RFILE* stream)
{
return filestream_write(stream, buffer, elem_size * elem_count);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (stdstring.c).

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2017 The RetroArch team
/* Copyright (C) 2010-2018 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (vfs_implementation.c).