Use retro_inline.h

This commit is contained in:
twinaphex 2016-03-27 05:07:20 +02:00
parent eaad54fc05
commit 2026f3015b
18 changed files with 89 additions and 65 deletions

View File

@ -352,7 +352,7 @@ ifeq ($(SINGLE_THREAD), 1)
COREFLAGS += -DSINGLE_THREAD
endif
COREFLAGS += -D__LIBRETRO__ -DINLINE="inline" -DM64P_PLUGIN_API -DM64P_CORE_PROTOTYPES -D_ENDUSER_RELEASE -DSINC_LOWER_QUALITY
COREFLAGS += -D__LIBRETRO__ -DM64P_PLUGIN_API -DM64P_CORE_PROTOTYPES -D_ENDUSER_RELEASE -DSINC_LOWER_QUALITY
ifeq ($(HAVE_OPENGL),1)

View File

@ -1,10 +1,12 @@
#ifndef _3DMATH_H
#define _3DMATH_H
#include <memory.h>
#include <math.h>
#include <memory.h>
#include <string.h>
#include <retro_inline.h>
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -1,6 +1,8 @@
#include <stdint.h>
#include <string.h>
#include <retro_inline.h>
#include "N64.h"
#include "RSP.h"
#include "GBI.h"

View File

@ -1,6 +1,8 @@
#ifndef TEXTURES_H
#define TEXTURES_H
#include <retro_inline.h>
#include <glsm/glsmsym.h>
#include "convert.h"

View File

@ -1,6 +1,9 @@
#ifndef CONVERT_H
#define CONVERT_H
#include <stdlib.h>
#include <retro_inline.h>
#if !defined(__MACH__) && !defined(__ppc__) && defined(__GNUC__)
#define HAVE_BSWAP
#endif
@ -8,7 +11,6 @@
#ifdef HAVE_BSWAP
#define bswap_32 __builtin_bswap32
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
#include <stdlib.h>
#define bswap_32(x) _byteswap_ulong(x)
#else
#define bswap_32(x) (((x) << 24) & 0xff000000) \

View File

@ -39,6 +39,8 @@
#include <stdint.h>
#include <string.h>
#include <retro_inline.h>
/* 8-bit Horizontal Mirror */
static void Mirror8bS (uint8_t *tex, uint32_t mask,
uint32_t max_width, uint32_t real_width, uint32_t height)

View File

@ -40,6 +40,8 @@
#ifndef RDP_H
#define RDP_H
#include <retro_inline.h>
#include "rdp_common/gdp.h"
#include "Gfx_1.3.h"
#include "../Glitch64/glide.h"

View File

@ -49,7 +49,9 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdbool.h>
#include <retro_inline.h>
#include <boolean.h>
#ifdef _MSC_VER
typedef unsigned __int8 uint8_t;

View File

@ -27,60 +27,60 @@ extern "C" {
#endif
#include <stddef.h>
#include "osal/preproc.h"
#include <retro_inline.h>
struct list_head {
struct list_head *prev;
struct list_head *next;
};
#define LIST_HEAD(list) \
struct list_head list = { &(list), &(list) }
#define LIST_HEAD(list) struct list_head list = { &(list), &(list) }
static osal_inline void INIT_LIST_HEAD(struct list_head *head)
static INLINE void INIT_LIST_HEAD(struct list_head *head)
{
head->next = head;
head->prev = head;
head->next = head;
head->prev = head;
}
static osal_inline void list_add(struct list_head *new_item, struct list_head *head)
static INLINE void list_add(struct list_head *new_item, struct list_head *head)
{
struct list_head *next = head->next;
struct list_head *next = head->next;
next->prev = new_item;
new_item->next = next;
new_item->prev = head;
head->next = new_item;
next->prev = new_item;
new_item->next = next;
new_item->prev = head;
head->next = new_item;
}
static osal_inline void list_add_tail(struct list_head *new_item, struct list_head *head)
static INLINE void list_add_tail(struct list_head *new_item, struct list_head *head)
{
struct list_head *prev = head->prev;
struct list_head *prev = head->prev;
prev->next = new_item;
new_item->next = head;
new_item->prev = prev;
head->prev = new_item;
prev->next = new_item;
new_item->next = head;
new_item->prev = prev;
head->prev = new_item;
}
static osal_inline void list_del(struct list_head *entry)
static INLINE void list_del(struct list_head *entry)
{
struct list_head *next = entry->next;
struct list_head *prev = entry->prev;
struct list_head *next = entry->next;
struct list_head *prev = entry->prev;
next->prev = prev;
prev->next = next;
next->prev = prev;
prev->next = next;
}
static osal_inline void list_del_init(struct list_head *entry)
static INLINE void list_del_init(struct list_head *entry)
{
list_del(entry);
INIT_LIST_HEAD(entry);
list_del(entry);
INIT_LIST_HEAD(entry);
}
static osal_inline int list_empty(const struct list_head *head)
static INLINE int list_empty(const struct list_head *head)
{
return (head->next == head);
return (head->next == head);
}
#ifdef __GNUC__

View File

@ -28,7 +28,8 @@ extern "C" {
#endif
#include <string.h>
#include "osal/preproc.h"
#include <retro_inline.h>
/**********************
Byte swap utilities
@ -43,42 +44,42 @@ extern "C" {
#define BUILTIN_BSWAP64 _byteswap_uint64
#endif
static osal_inline unsigned short m64p_swap16(unsigned short x)
static INLINE unsigned short m64p_swap16(unsigned short x)
{
#ifdef BUILTIN_BSWAP16
return BUILTIN_BSWAP16(x);
#else
return ((x & 0x00FF) << 8) |
((x & 0xFF00) >> 8);
#endif
#ifdef BUILTIN_BSWAP16
return BUILTIN_BSWAP16(x);
#else
return ((x & 0x00FF) << 8) |
((x & 0xFF00) >> 8);
#endif
}
static osal_inline unsigned int m64p_swap32(unsigned int x)
static INLINE unsigned int m64p_swap32(unsigned int x)
{
#ifdef BUILTIN_BSWAP32
return BUILTIN_BSWAP32(x); // long is always 32-bit in Windows
#else
return ((x & 0x000000FF) << 24) |
((x & 0x0000FF00) << 8) |
((x & 0x00FF0000) >> 8) |
((x & 0xFF000000) >> 24);
#endif
#ifdef BUILTIN_BSWAP32
return BUILTIN_BSWAP32(x); // long is always 32-bit in Windows
#else
return ((x & 0x000000FF) << 24) |
((x & 0x0000FF00) << 8) |
((x & 0x00FF0000) >> 8) |
((x & 0xFF000000) >> 24);
#endif
}
static osal_inline unsigned long long int m64p_swap64(unsigned long long int x)
static INLINE unsigned long long int m64p_swap64(unsigned long long int x)
{
#ifdef BUILTIN_BSWAP64
return BUILTIN_BSWAP64(x);
#else
return ((x & 0x00000000000000FFULL) << 56) |
((x & 0x000000000000FF00ULL) << 40) |
((x & 0x0000000000FF0000ULL) << 24) |
((x & 0x00000000FF000000ULL) << 8) |
((x & 0x000000FF00000000ULL) >> 8) |
((x & 0x0000FF0000000000ULL) >> 24) |
((x & 0x00FF000000000000ULL) >> 40) |
((x & 0xFF00000000000000ULL) >> 56);
#endif
#ifdef BUILTIN_BSWAP64
return BUILTIN_BSWAP64(x);
#else
return ((x & 0x00000000000000FFULL) << 56) |
((x & 0x000000000000FF00ULL) << 40) |
((x & 0x0000000000FF0000ULL) << 24) |
((x & 0x00000000FF000000ULL) << 8) |
((x & 0x000000FF00000000ULL) >> 8) |
((x & 0x0000FF0000000000ULL) >> 24) |
((x & 0x00FF000000000000ULL) >> 40) |
((x & 0xFF00000000000000ULL) >> 56);
#endif
}
#ifdef MSB_FIRST

View File

@ -35,7 +35,6 @@
#endif
#define ALIGN(BYTES,DATA) __declspec(align(BYTES)) DATA
#define osal_inline __inline
/* string functions */
#define osal_insensitive_strcmp(x, y) _stricmp(x, y)
@ -54,7 +53,6 @@
// macros
#define OSAL_BREAKPOINT_INTERRUPT __asm__(" int $3; ");
#define ALIGN(BYTES,DATA) DATA __attribute__((aligned(BYTES)))
#define osal_inline inline
// string functions
#define osal_insensitive_strcmp(x, y) strcasecmp(x, y)

View File

@ -30,6 +30,8 @@
#include <stdlib.h>
#include <stdint.h>
#include <retro_inline.h>
#ifdef __x86_64__
extern int64_t reg[32];
typedef uint64_t native_type;

View File

@ -1,4 +1,3 @@
#include "gdp.h"
#include "../plugin/plugin.h"

View File

@ -3,6 +3,8 @@
#include <stdint.h>
#include <retro_inline.h>
#ifndef DP_INTERRUPT
#define DP_INTERRUPT 0x20
#endif

View File

@ -14,6 +14,8 @@
unsigned char rsp_conf[32];
#include <retro_inline.h>
#include "config.h"
#include <stdio.h>

View File

@ -22,6 +22,8 @@
#ifndef ARITHMETICS_H
#define ARITHMETICS_H
#include <retro_inline.h>
#include <stdint.h>
static INLINE int16_t clamp_s16(int_fast32_t x)

View File

@ -27,6 +27,8 @@
#include <stdint.h>
#include <string.h>
#include <retro_inline.h>
#include "hle_internal.h"
#ifdef MSB_FIRST

View File

@ -4,6 +4,8 @@
#include <stdio.h>
#include <stdint.h>
#include <retro_inline.h>
typedef uint64_t UINT64;
typedef int64_t INT64;
typedef uint32_t UINT32;