Moved stdlib to a seperate folder and added some more headers that are required for compiling libgcc (no implementation yet).
This commit is contained in:
47
targets/_any/stdlib/include/stdio.h
Normal file
47
targets/_any/stdlib/include/stdio.h
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(BAD_APPLE_OS_STDIO_H_INCLUDED)
|
||||
#define BAD_APPLE_OS_STDIO_H_INCLUDED
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include "./detail/common.h"
|
||||
|
||||
#define stdin __stdin
|
||||
|
||||
BA_EXTERN_C_BEGIN
|
||||
|
||||
typedef struct __file FILE;
|
||||
|
||||
extern FILE* __stdin;
|
||||
|
||||
static int EOF = -1;
|
||||
|
||||
int putchar(int chr) BA_CXX_NOEXCEPT;
|
||||
int puts(const char* str) BA_CXX_NOEXCEPT;
|
||||
int printf(const char* BA_C_RESTRICT format, ...) BA_CXX_NOEXCEPT __attribute__((format(printf, 1, 2)));
|
||||
int vprintf(const char* BA_C_RESTRICT format, va_list vlist) BA_CXX_NOEXCEPT;
|
||||
int sprintf(char* BA_C_RESTRICT buffer, const char* BA_C_RESTRICT format, ...) BA_CXX_NOEXCEPT;
|
||||
int snprintf(char* BA_C_RESTRICT buffer, size_t bufferSize, const char* BA_C_RESTRICT format, ...) BA_CXX_NOEXCEPT __attribute__((format(printf, 3, 4)));
|
||||
int vsnprintf(char* BA_C_RESTRICT buffer, size_t bufferSize, const char* BA_C_RESTRICT format, va_list vlist) BA_CXX_NOEXCEPT;
|
||||
|
||||
int fclose(FILE* stream) BA_CXX_NOEXCEPT;
|
||||
int fflush(FILE* stream) BA_CXX_NOEXCEPT;
|
||||
int fgetc(FILE* stream) BA_CXX_NOEXCEPT;
|
||||
FILE* fopen(const char* BA_C_RESTRICT filename, const char* BA_C_RESTRICT mode) BA_CXX_NOEXCEPT;
|
||||
char* fgets(char* buffer, int count, FILE* stream) BA_CXX_NOEXCEPT;
|
||||
int fprintf(FILE* BA_C_RESTRICT stream, const char* BA_C_RESTRICT format, ...) BA_CXX_NOEXCEPT __attribute__((format(printf, 2, 3)));
|
||||
size_t fread(void* BA_C_RESTRICT buffer, size_t size, size_t count, FILE* BA_C_RESTRICT stream) BA_CXX_NOEXCEPT;
|
||||
int fseek(FILE* stream, long offset, int origin) BA_CXX_NOEXCEPT;
|
||||
long ftell(FILE* stream) BA_CXX_NOEXCEPT;
|
||||
size_t fwrite(const void* BA_C_RESTRICT buffer, size_t size, size_t count, FILE* BA_C_RESTRICT stream) BA_CXX_NOEXCEPT;
|
||||
void setbuf(FILE* BA_C_RESTRICT stream, char* BA_C_RESTRICT buffer) BA_CXX_NOEXCEPT;
|
||||
int vfprintf(FILE* BA_C_RESTRICT stream, const char* BA_C_RESTRICT format, va_list vlist) BA_CXX_NOEXCEPT;
|
||||
|
||||
inline int getc(FILE* stream) BA_CXX_NOEXCEPT { return fgetc(stream); }
|
||||
inline int getchar() BA_CXX_NOEXCEPT { return fgetc(stdin); }
|
||||
|
||||
BA_EXTERN_C_END
|
||||
|
||||
#endif // !defined(BAD_APPLE_OS_STDIO_H_INCLUDED)
|
||||
Reference in New Issue
Block a user