add C++ header guards

This commit is contained in:
Lephe 2021-06-13 18:13:09 +02:00
parent 9939896c6a
commit 10180d31bc
Signed by untrusted user: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
37 changed files with 298 additions and 2 deletions

View File

@ -9,6 +9,10 @@
#ifndef GINT_BFILE
#define GINT_BFILE
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
/* BFile_Remove(): Remove a file
@ -137,4 +141,8 @@ int BFile_FindNext(int shandle, uint16_t *foundfile,
Return 0 on success or negative value on error. */
int BFile_FindClose(int shandle);
#ifdef __cplusplus
}
#endif
#endif /* GINT_BFILE */

View File

@ -5,6 +5,10 @@
#ifndef GINT_CLOCK
#define GINT_CLOCK
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
/* This header used to expose the sleep() function; include <gint/cpu.h> to
ensure this is still the case */
@ -72,4 +76,8 @@ void sleep_us_spin(uint64_t delay_us);
/* sleep_ms(): Sleep for a fixed duration in milliseconds */
#define sleep_ms(delay_ms) sleep_us((delay_ms) * 1000ull)
#ifdef __cplusplus
}
#endif
#endif /* GINT_CLOCK */

View File

@ -5,6 +5,10 @@
#ifndef GINT_CPU
#define GINT_CPU
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
//---
@ -117,4 +121,8 @@ void sleep_unblock(void);
configure(), this is reset to 0. */
void cpu_configure_VBR(uint32_t VBR);
#ifdef __cplusplus
}
#endif
#endif /* GINT_CPU */

View File

@ -11,6 +11,10 @@
#ifndef GINT_DEFS_CALL
#define GINT_DEFS_CALL
#ifdef __cplusplus
extern "C" {
#endif
/* gint_call_arg_t: All types of arguments allowed in an indirect call
Because a function call cannot be easily pieced together, there are
@ -195,4 +199,8 @@ static GINLINE gint_call_t GINT_CALL_INC_STOP(int volatile *pointer)
return GINT_CALL(GINT_CALL_INC_STOP_function, pointer);
}
#ifdef __cplusplus
}
#endif
#endif /* GINT_DEFS_CALL */

View File

@ -13,6 +13,10 @@
#ifdef FXCG50
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
/* Dimensions of the VRAM */
@ -123,6 +127,10 @@ void dsetvram(uint16_t *main, uint16_t *secondary);
Returns the VRAM buffer addresses used to render on fx-CG 50. */
void dgetvram(uint16_t **main, uint16_t **secondary);
#ifdef __cplusplus
}
#endif
#endif /* FXCG50 */
#endif /* GINT_DISPLAY_CG */

View File

@ -11,6 +11,10 @@
#ifdef FX9860G
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
/* Dimensions of the VRAM */
@ -83,6 +87,10 @@ typedef struct
} GPACKED(4) bopti_image_t;
#ifdef __cplusplus
}
#endif
#endif /* FX9860G */
#endif /* GINT_DISPLAY_FX */

View File

@ -9,6 +9,10 @@
#ifndef GINT_DISPLAY
#define GINT_DISPLAY
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
/* Platform-specific functions include VRAM management and the definition of
@ -398,4 +402,8 @@ enum {
void dsubimage(int x, int y, bopti_image_t const *image, int left, int top,
int width, int height, int flags);
#ifdef __cplusplus
}
#endif
#endif /* GINT_DISPLAY */

View File

@ -5,6 +5,10 @@
#ifndef GINT_DMA
#define GINT_DMA
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
#include <gint/defs/call.h>
@ -117,4 +121,8 @@ void *dma_memset(void *dst, uint32_t pattern, size_t size);
void *dma_memcpy(void * __restrict dst, const void * __restrict src,
size_t size);
#ifdef __cplusplus
}
#endif
#endif /* GINT_DMA */

View File

@ -5,6 +5,10 @@
#ifndef GINT_DRIVERS
#define GINT_DRIVERS
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/attributes.h>
#include <gint/defs/types.h>
@ -300,4 +304,8 @@ void gint_world_switch_in(gint_world_t world_os, gint_world_t world_addin);
/* Switch from a gint-managed world to the OS world */
void gint_world_switch_out(gint_world_t world_addin, gint_world_t world_os);
#ifdef __cplusplus
}
#endif
#endif /* GINT_DRIVERS */

View File

@ -7,6 +7,10 @@
#ifndef GINT_DRIVERS_IOKBD
#define GINT_DRIVERS_IOKBD
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
/* iokbd_scan() - scan ports A/B/M to generate 12 rows of key data
@ -14,4 +18,8 @@
@scan 12-byte buffer filled with row data */
void iokbd_scan(uint8_t *scan);
#ifdef __cplusplus
}
#endif
#endif /* GINT_DRIVERS_IOKBD */

View File

@ -2,11 +2,15 @@
// gint:keydev - Kernel's keyboard input devices
//---
#include <gint/keyboard.h>
#ifndef GINT_KEYDEV
#define GINT_KEYDEV
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/keyboard.h>
/* Size of the buffer event queue */
#define KEYBOARD_QUEUE_SIZE 32
@ -261,4 +265,8 @@ void keydev_set_transform(keydev_t *d, keydev_transform_t tr);
/* keydev_read(): Retrieve the next transformed event */
key_event_t keydev_read(keydev_t *d);
#ifdef __cplusplus
}
#endif
#endif /* GINT_KEYDEV */

View File

@ -8,6 +8,10 @@
#ifndef GINT_DRIVERS_R61524
#define GINT_DRIVERS_R61524
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
enum {
@ -43,4 +47,8 @@ void r61524_display(uint16_t *vram, int start, int height, int method);
void r61524_win_get(uint16_t *HSA, uint16_t *HEA, uint16_t *VSA,uint16_t *VEA);
void r61524_win_set(uint16_t HSA, uint16_t HEA, uint16_t VSA, uint16_t VEA);
#ifdef __cplusplus
}
#endif
#endif /* GINT_DRIVERS_R61524 */

View File

@ -9,6 +9,10 @@
#ifndef GINT_DRIVERS_STATES
#define GINT_DRIVERS_STATES
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/mpu/dma.h>
/* Clock Pulse Generator (see cpg/cpg.c) */
@ -91,4 +95,8 @@ typedef struct {
uint16_t DCPCFG, DCPMAXP, DCPCTR;
} usb_state_t;
#ifdef __cplusplus
}
#endif
#endif /* GINT_DRIVERS_STATES */

View File

@ -7,6 +7,10 @@
#ifndef GINT_DRIVERS_T6K11
#define GINT_DRIVERS_T6K11
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
/* t6k11_display() - send vram data to the LCD device
@ -51,4 +55,8 @@ void t6k11_contrast(int contrast);
@setting Requested backlight setting */
void t6k11_backlight(int setting);
#ifdef __cplusplus
}
#endif
#endif /* GINT_DRIVERS_T6K11 */

View File

@ -9,6 +9,10 @@
#ifndef GINT_EXC
#define GINT_EXC
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/attributes.h>
#include <stdint.h>
@ -64,4 +68,8 @@ void gint_exc_catch(int (*handler)(uint32_t code));
@instructions Number of instructions to skip (usually only one) */
void gint_exc_skip(int instructions);
#ifdef __cplusplus
}
#endif
#endif /* GINT_EXC */

View File

@ -5,6 +5,10 @@
#ifndef GINT_GINT
#define GINT_GINT
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
#include <gint/defs/call.h>
#include <gint/config.h>
@ -89,4 +93,8 @@ static GINLINE void *gint_inthandler(int code, void const *h, size_t size) {
Returns the return value of the callback. */
extern int (*gint_inth_callback)(gint_call_t const *call);
#ifdef __cplusplus
}
#endif
#endif /* GINT_GINT */

View File

@ -5,6 +5,10 @@
#ifndef GINT_GRAY
#define GINT_GRAY
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
#include <gint/display.h>
@ -148,4 +152,8 @@ void dgray_getvram(uint32_t **light, uint32_t **dark);
These pointers can be used to make screen captures. */
void dgray_getscreen(uint32_t **light, uint32_t **dark);
#ifdef __cplusplus
}
#endif
#endif /* GINT_GRAY */

View File

@ -14,6 +14,10 @@
#ifndef GINT_HARDWARE
#define GINT_HARDWARE
#ifdef __cplusplus
extern "C" {
#endif
/* For compatibility with ASM, include the following bits only in C code */
#ifndef CPP_ASM
@ -114,4 +118,8 @@ void hw_detect(void);
/* The keyboard uses a KEYSC-based scan method. This is only possible on SH4 */
#define HWKBD_KSI 0x04
#ifdef __cplusplus
}
#endif
#endif /* GINT_HARDWARE */

View File

@ -5,6 +5,10 @@
#ifndef GINT_INTC
#define GINT_INTC
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
#include <gint/defs/call.h>
@ -131,4 +135,8 @@ void *intc_handler(int event_code, void const *handler, size_t size);
Returns true on success, false if the event code is invalid. */
bool intc_handler_function(int event_code, gint_call_t function);
#ifdef __cplusplus
}
#endif
#endif /* GINT_INTC */

View File

@ -5,6 +5,10 @@
#ifndef GINT_KEYBOARD
#define GINT_KEYBOARD
#ifdef __cplusplus
extern "C" {
#endif
/* Keyboard, key events, keydown() and getkey()
gint's keyboard driver regularly scans the keyboard matrix and produces *key
@ -329,4 +333,8 @@ int keycode_function(int keycode);
returns 7 for KEY_7) and -1 for other keys. */
int keycode_digit(int keycode);
#ifdef __cplusplus
}
#endif
#endif /* GINT_KEYBOARD */

View File

@ -5,6 +5,10 @@
#ifndef GINT_KEYCODES
#define GINT_KEYCODES
#ifdef __cplusplus
extern "C" {
#endif
/* Raw matrix codes */
enum {
KEY_F1 = 0x91,
@ -83,4 +87,8 @@ enum {
KEY_MINUS = KEY_SUB,
};
#ifdef __cplusplus
}
#endif
#endif /* GINT_KEYCODES */

View File

@ -5,6 +5,10 @@
#ifndef GINT_KMALLOC
#define GINT_KMALLOC
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/config.h>
#include <gint/defs/types.h>
@ -164,4 +168,8 @@ int kmallocdbg_sequence_length(kmalloc_arena_t *a);
#endif /* GINT_KMALLOC_DEBUG */
#ifdef __cplusplus
}
#endif
#endif /* GINT_KMALLOC */

View File

@ -5,6 +5,10 @@
#ifndef GINT_MMU
#define GINT_MMU
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/mpu/mmu.h>
//---
@ -94,4 +98,8 @@ void utlb_mapped_memory(uint32_t *rom, uint32_t *ram);
/* utlb_translate(): Get the physical address for a virtual page */
uint32_t utlb_translate(uint32_t page, uint32_t *size);
#ifdef __cplusplus
}
#endif
#endif /* GINT_MMU */

View File

@ -5,6 +5,10 @@
#ifndef GINT_MPU_CPG
#define GINT_MPU_CPG
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/attributes.h>
#include <gint/defs/types.h>
@ -110,4 +114,8 @@ typedef volatile struct
#define SH7305_CPG (*((sh7305_cpg_t *)0xa4150000))
#ifdef __cplusplus
}
#endif
#endif /* GINT_MPU_CPG */

View File

@ -9,6 +9,10 @@
#ifndef GINT_MPU_DMA
#define GINT_MPU_DMA
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
//---
@ -86,4 +90,8 @@ typedef volatile struct
#define SH7305_DMA (*((sh7305_dma_t *)0xfe008020))
#ifdef __cplusplus
}
#endif
#endif /* GINT_MPU_DMA */

View File

@ -12,6 +12,10 @@
#ifndef GINT_MPU_INTC
#define GINT_MPU_INTC
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
//---
@ -297,4 +301,8 @@ typedef struct
extern sh7705_intc_t SH7705_INTC;
extern sh7305_intc_t SH7305_INTC;
#ifdef __cplusplus
}
#endif
#endif /* GINT_MPU_INTC */

View File

@ -8,6 +8,10 @@
#ifndef GINT_MPU_MMU
#define GINT_MPU_MMU
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/attributes.h>
#include <gint/defs/types.h>
@ -152,4 +156,8 @@ typedef volatile struct
#define SH7305_MMU (*(sh7305_mmu_t *)0xff000000)
#ifdef __cplusplus
}
#endif
#endif /* GINT_MPU_MMU */

View File

@ -8,6 +8,10 @@
#ifndef GINT_MPU_PFC
#define GINT_MPU_PFC
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/attributes.h>
#include <gint/defs/types.h>
@ -75,4 +79,8 @@ typedef volatile struct
// TODO: Document the SH7305 Pin Function Controller
//---
#ifdef __cplusplus
}
#endif
#endif /* GINT_MPU_PFC */

View File

@ -5,6 +5,10 @@
#ifndef GINT_MPU_POWER
#define GINT_MPU_POWER
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
//---
@ -103,4 +107,8 @@ typedef volatile struct
#define SH7305_POWER (*((sh7305_power_t *)0xa4150020))
#ifdef __cplusplus
}
#endif
#endif /* GINT_MPU_POWER */

View File

@ -5,6 +5,10 @@
#ifndef GINT_MPU_RTC
#define GINT_MPU_RTC
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/attributes.h>
//---
@ -75,4 +79,8 @@ typedef volatile struct
#define SH7705_RTC (*((rtc_t *)0xfffffec0))
#define SH7305_RTC (*((rtc_t *)0xa413fec0))
#ifdef __cplusplus
}
#endif
#endif /* GINT_MPU_RTC */

View File

@ -5,6 +5,10 @@
#ifndef GINT_MPU_SPU
#define GINT_MPU_SPU
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
typedef volatile struct
@ -94,4 +98,8 @@ typedef volatile struct
#define SH7305_DSP0 (*(spu_dsp_t *)0xfe2ffd00)
#define SH7305_DSP1 (*(spu_dsp_t *)0xfe3ffd00)
#ifdef __cplusplus
}
#endif
#endif /* GINT_MPU_SPU */

View File

@ -9,6 +9,10 @@
#ifndef GINT_MPU_TMU
#define GINT_MPU_TMU
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
//---
@ -101,4 +105,8 @@ typedef volatile struct
typedef volatile etmu_t sh7305_etmu_t[6];
#define SH7305_ETMU (*(sh7305_etmu_t *)0xa44d0030)
#ifdef __cplusplus
}
#endif
#endif /* GINT_MPU_TMU */

View File

@ -5,6 +5,10 @@
#ifndef GINT_MPU_USB
#define GINT_MPU_USB
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
typedef volatile struct
@ -437,4 +441,8 @@ typedef volatile word_union(sh7305_usb_uponcr_t,
#define SH7305_USB (*(sh7305_usb_t *)0xa4d80000)
#define SH7305_USB_UPONCR (*(sh7305_usb_uponcr_t *)0xa40501d4)
#ifdef __cplusplus
}
#endif
#endif /* GINT_MPU_USB */

View File

@ -5,6 +5,10 @@
#ifndef GINT_RTC
#define GINT_RTC
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
#include <gint/defs/call.h>
#include <gint/timer.h>
@ -96,4 +100,8 @@ int rtc_start_timer(int frequency, timer_callback_t callback, ...);
__attribute__((deprecated("Use rtc_periodic_disable() instead")))
void rtc_stop_timer(void);
#ifdef __cplusplus
}
#endif
#endif /* GINT_RTC */

View File

@ -5,6 +5,10 @@
#ifndef GINT_TIMER
#define GINT_TIMER
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/mpu/tmu.h>
#include <gint/hardware.h>
#include <gint/defs/types.h>
@ -236,4 +240,8 @@ int timer_setup(int timer, uint64_t delay_us, timer_callback_t callback, ...);
Use GINT_CALL_SET_STOP() with timer_configure() instead. */
int timer_timeout(volatile void *arg);
#ifdef __cplusplus
}
#endif
#endif /* GINT_TIMER */

View File

@ -5,6 +5,10 @@
#ifndef GINT_USB_FF_BULK
#define GINT_USB_FF_BULK
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/usb.h>
/* The bulk transfer interface with class code 0xff provides a very simple
@ -164,4 +168,8 @@ void usb_fxlink_screenshot_gray(bool onscreen);
and size allow, and 1 byte otherwise. If size is 0, strlen(text) is used. */
void usb_fxlink_text(char const *text, int size);
#ifdef __cplusplus
}
#endif
#endif /* GINT_USB_FF_BULK */

View File

@ -5,6 +5,10 @@
#ifndef GINT_USB
#define GINT_USB
#ifdef __cplusplus
extern "C" {
#endif
#include <gint/defs/types.h>
#include <gint/std/endian.h>
#include <gint/gint.h>
@ -376,4 +380,8 @@ uint16_t usb_dc_string(uint16_t const *literal, size_t len);
This is mostly used by the driver to answer GET_DESCRIPTOR requests. */
usb_dc_string_t *usb_dc_string_get(uint16_t id);
#ifdef __cplusplus
}
#endif
#endif /* GINT_USB */