1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-08 12:15:49 +00:00

Don't make asserts dependent on retro_log.h

This commit is contained in:
twinaphex 2015-09-01 11:59:27 +02:00
parent 7bcb3d4f27
commit 15ba019ea1
19 changed files with 107 additions and 48 deletions

View File

@ -19,11 +19,13 @@
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
#include <string.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
#include <file/file_path.h>
#include <string/string_list.h>
#include "7zip_support.h"
#include "../deps/7zip/7z.h"

View File

@ -21,6 +21,7 @@
#include <sys/types.h>
#include <string.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
#include <file/file_path.h>

View File

@ -14,21 +14,24 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "file_ops.h"
#include <file/file_path.h>
#include <stdlib.h>
#include <boolean.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
#include <file/file_path.h>
#ifdef HAVE_COMPRESSION
#include <file/file_extract.h>
#endif
#include "file_ops.h"
#ifdef HAVE_7ZIP
#include "decompress/7zip_support.h"
#endif

View File

@ -20,15 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <file/file_path.h>
#include <stdlib.h>
#include <boolean.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <retro_miscellaneous.h>
#ifdef __HAIKU__
#include <kernel/image.h>
@ -73,6 +69,12 @@
#include <CoreFoundation/CoreFoundation.h>
#endif
#include <file/file_path.h>
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
void fill_pathname_expand_special(char *out_path,
const char *in_path, size_t size)
{

View File

@ -22,6 +22,7 @@
#include <limits.h>
#include <compat/strl.h>
#include <retro_inline.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
#include "configuration.h"
#include "driver.h"

View File

@ -18,6 +18,8 @@
#define _INPUT_AUTODETECT_H
#include <stdint.h>
#include <boolean.h>
#include <retro_miscellaneous.h>
typedef struct autoconfig_params

View File

@ -21,6 +21,7 @@
#include <compat/posix_string.h>
#include <file/file_path.h>
#include <retro_assert.h>
#include <string/string_list.h>
#include <file/config_file.h>
#include <formats/image.h>

View File

@ -20,19 +20,11 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <file/config_file.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <compat/msvc.h>
#include <file/file_path.h>
#include <retro_miscellaneous.h>
#include <string/string_list.h>
#include <rhash.h>
#if !defined(_WIN32) && !defined(__CELLOS_LV2__) && !defined(_XBOX)
#include <sys/param.h> /* PATH_MAX */
@ -43,8 +35,17 @@
#include <xtl.h>
#endif
#define MAX_INCLUDE_DEPTH 16
#include <file/config_file.h>
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <compat/msvc.h>
#include <file/file_path.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
#include <string/string_list.h>
#include <rhash.h>
#define MAX_INCLUDE_DEPTH 16
static config_file_t *config_file_new_internal(const char *path, unsigned depth);
void config_file_free(config_file_t *conf);

View File

@ -20,7 +20,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <file/file_path.h>
#include <stdlib.h>
#include <boolean.h>
@ -28,26 +27,6 @@
#include <time.h>
#include <errno.h>
#ifdef __HAIKU__
#include <kernel/image.h>
#endif
#if (defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)) || defined(__QNX__) || defined(PSP)
#include <unistd.h> /* stat() is defined here */
#endif
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <retro_miscellaneous.h>
#if defined(__CELLOS_LV2__)
#ifndef S_ISDIR
#define S_ISDIR(x) (x & 0040000)
#endif
#endif
#if defined(_WIN32)
#ifdef _MSC_VER
#define setmode _setmode
@ -75,6 +54,30 @@
#include <pspkernel.h>
#endif
#ifdef __HAIKU__
#include <kernel/image.h>
#endif
#if (defined(__CELLOS_LV2__) && !defined(__PSL1GHT__)) || defined(__QNX__) || defined(PSP)
#include <unistd.h> /* stat() is defined here */
#endif
#include <file/file_path.h>
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
#if defined(__CELLOS_LV2__)
#ifndef S_ISDIR
#define S_ISDIR(x) (x & 0040000)
#endif
#endif
/**
* path_get_extension:
* @path : path

View File

@ -0,0 +1,40 @@
/* Copyright (C) 2010-2015 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_assert.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 __RETRO_ASSERT_H
#define __RETRO_ASSERT_H
#ifdef RARCH_INTERNAL
#include <retro_log.h>
#else
#include <assert.h>
#endif
#ifdef RARCH_INTERNAL
#define rarch_assert(cond) do { \
if (!(cond)) { RARCH_ERR("Assertion failed at %s:%d.\n", __FILE__, __LINE__); abort(); } \
} while(0)
#else
#define rarch_assert(cond) assert(cond)
#endif
#endif

View File

@ -49,7 +49,6 @@
#endif
#include <compat/msvc.h>
#include <retro_log.h>
#include <retro_inline.h>
#include <retro_endianness.h>
#include <limits.h>
@ -66,15 +65,6 @@
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
#ifdef RARCH_INTERNAL
#define rarch_assert(cond) do { \
if (!(cond)) { RARCH_ERR("Assertion failed at %s:%d.\n", __FILE__, __LINE__); abort(); } \
} while(0)
#else
#include <assert.h>
#define rarch_assert(cond) assert(cond)
#endif
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#define RARCH_SCALE_BASE 256

View File

@ -24,6 +24,7 @@
#include <stdint.h>
#include <string/string_list.h>
#include <string.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
#include <compat/strl.h>
#include <compat/posix_string.h>

View File

@ -14,6 +14,8 @@
*/
#include <file/file_path.h>
#include <compat/strl.h>
#include "../menu.h"
#include "../menu_cbs.h"
#include "../menu_entry.h"

View File

@ -16,6 +16,9 @@
#include <stdint.h>
#include <string.h>
#include <retro_assert.h>
#include "../../configuration.h"
#include "../menu_hash.h"

View File

@ -17,6 +17,8 @@
#include <stdint.h>
#include <string.h>
#include <retro_assert.h>
#include "../menu_hash.h"
#include "../../configuration.h"

View File

@ -17,6 +17,7 @@
#include <string.h>
#include <compat/strl.h>
#include <retro_assert.h>
#include <file/file_path.h>
#include "menu.h"

View File

@ -14,6 +14,8 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include <rhash.h>
#include "msg_hash.h"

View File

@ -16,6 +16,7 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <retro_assert.h>
#include <queues/message_queue.h>
#ifdef HAVE_THREADS
#include <rthreads/rthreads.h>

View File

@ -19,6 +19,7 @@
#include <formats/image.h>
#include <formats/rpng.h>
#include <compat/strl.h>
#include <retro_assert.h>
#include <retro_miscellaneous.h>
#include <queues/message_queue.h>
#include <string/string_list.h>