Skip to content

Commit

Permalink
Merge pull request #978 from no92/little-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
no92 authored Feb 4, 2024
2 parents 84d7a13 + bb44cf5 commit 08d7213
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 23 deletions.
1 change: 1 addition & 0 deletions abis/linux/in.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <bits/posix/in_addr_t.h>
#include <bits/posix/in_port_t.h>
#include <abi-bits/socket.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
Expand Down
30 changes: 15 additions & 15 deletions options/ansi/include/stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,51 +101,51 @@ void setbuffer(FILE *, char *, size_t);

// [C11-7.21.6] Formatted input/output functions

__attribute__((__format__(gnu_printf, 2, 3)))
__attribute__((__format__(printf, 2, 3)))
int fprintf(FILE *__restrict stream, const char *__restrict format, ...);

__attribute__((__format__(gnu_scanf, 2, 3)))
__attribute__((__format__(scanf, 2, 3)))
int fscanf(FILE *__restrict stream, const char *__restrict format, ...);

__attribute__((__format__(gnu_printf, 1, 2)))
__attribute__((__format__(printf, 1, 2)))
int printf(const char *__restrict format, ...);

__attribute__((__format__(gnu_scanf, 1, 2)))
__attribute__((__format__(scanf, 1, 2)))
int scanf(const char *__restrict format, ...);

__attribute__((__format__(gnu_printf, 3, 4)))
__attribute__((__format__(printf, 3, 4)))
int snprintf(char *__restrict buffer, size_t max_size, const char *__restrict format, ...);

__attribute__((__format__(gnu_printf, 2, 3)))
__attribute__((__format__(printf, 2, 3)))
int sprintf(char *__restrict buffer, const char *__restrict format, ...);

__attribute__((__format__(gnu_scanf, 2, 3)))
__attribute__((__format__(scanf, 2, 3)))
int sscanf(const char *__restrict buffer, const char *__restrict format, ...);

__attribute__((__format__(gnu_printf, 2, 0)))
__attribute__((__format__(printf, 2, 0)))
int vfprintf(FILE *__restrict stream, const char *__restrict format, __builtin_va_list args);

__attribute__((__format__(gnu_scanf, 2, 0)))
__attribute__((__format__(scanf, 2, 0)))
int vfscanf(FILE *__restrict stream, const char *__restrict format, __builtin_va_list args);

__attribute__((__format__(gnu_printf, 1, 0)))
__attribute__((__format__(printf, 1, 0)))
int vprintf(const char *__restrict format, __builtin_va_list args);

__attribute__((__format__(gnu_scanf, 1, 0)))
__attribute__((__format__(scanf, 1, 0)))
int vscanf(const char *__restrict format, __builtin_va_list args);

__attribute__((__format__(gnu_printf, 3, 0)))
__attribute__((__format__(printf, 3, 0)))
int vsnprintf(char *__restrict buffer, size_t max_size,
const char *__restrict format, __builtin_va_list args);

__attribute__((__format__(gnu_printf, 2, 0)))
__attribute__((__format__(printf, 2, 0)))
int vsprintf(char *__restrict buffer, const char *__restrict format, __builtin_va_list args);

__attribute__((__format__(gnu_scanf, 2, 0)))
__attribute__((__format__(scanf, 2, 0)))
int vsscanf(const char *__restrict buffer, const char *__restrict format, __builtin_va_list args);

// this is a gnu extension
__attribute__((__format__(gnu_printf, 2, 0)))
__attribute__((__format__(printf, 2, 0)))
int vasprintf(char **, const char *, __builtin_va_list);

// [C11-7.21.7] Character input/output functions
Expand Down
2 changes: 2 additions & 0 deletions options/bsd/include/bits/bsd/bsd_unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
extern "C" {
#endif

#include <stdint.h>

#ifndef __MLIBC_ABI_ONLY

void *sbrk(intptr_t increment);
Expand Down
2 changes: 2 additions & 0 deletions options/glibc/include/net/route.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef _NET_ROUTE_H
#define _NET_ROUTE_H

#include <sys/socket.h>

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
1 change: 1 addition & 0 deletions options/glibc/include/netipx/ipx.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <mlibc-config.h>
#include <sys/socket.h>
#include <stdint.h>

typedef struct ipx_config_data {
unsigned char ipxcfg_auto_select_primary;
Expand Down
11 changes: 4 additions & 7 deletions options/linux/include/scsi/sg.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@

#define SG_GET_VERSION_NUM 0x2282

#define SG_DXFER_NONE (-1)
#define SG_DXFER_FROM_DEV (-3)

#define SG_FLAG_DIRECT_IO 1
#define SG_FLAG_LUN_INHIBIT 2

#define SG_INFO_OK 0x0
#define SG_INFO_OK_MASK 0x1

#define SG_DXFER_NONE -1
#define SG_DXFER_TO_DEV -2
#define SG_DXFER_TO_FROM_DEV -3
#define SG_DXFER_TO_FROM_DEV -4
#define SG_DXFER_NONE (-1)
#define SG_DXFER_TO_DEV (-2)
#define SG_DXFER_FROM_DEV (-3)
#define SG_DXFER_TO_FROM_DEV (-4)

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 2 additions & 0 deletions options/posix/include/bits/posix/in_addr_t.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef MLIBC_IN_ADDR_H
#define MLIBC_IN_ADDR_H

#include <stdint.h>

typedef uint32_t in_addr_t;

#endif // MLIBC_IN_ADDR_H
2 changes: 2 additions & 0 deletions options/posix/include/bits/posix/in_port_t.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef MLIBC_IN_PORT_H
#define MLIBC_IN_PORT_H

#include <stdint.h>

typedef uint16_t in_port_t;

#endif // MLIBC_IN_PORT_H
2 changes: 2 additions & 0 deletions options/posix/include/bits/posix/posix_stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ extern "C" {

#ifndef __MLIBC_ABI_ONLY

typedef struct __mlibc_file_base FILE;

int fileno(FILE *file);
FILE *fdopen(int fd, const char *mode);

Expand Down
1 change: 1 addition & 0 deletions options/posix/include/bits/posix/posix_stdlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define MLIBC_POSIX_STDLIB_H

#include <bits/posix/locale_t.h>
#include <bits/size_t.h>

#ifdef __cplusplus
extern "C" {
Expand Down
1 change: 1 addition & 0 deletions options/posix/include/bits/posix/posix_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <alloca.h>
#include <bits/posix/locale_t.h>
#include <bits/size_t.h>

#ifdef __cplusplus
extern "C" {
Expand Down
3 changes: 3 additions & 0 deletions options/posix/include/bits/posix/posix_wctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ extern "C" {

#ifndef __MLIBC_ABI_ONLY

typedef unsigned long wctype_t;
typedef unsigned long wctrans_t;

int iswalnum_l(wint_t, locale_t);
int iswblank_l(wint_t, locale_t);
int iswcntrl_l(wint_t, locale_t);
Expand Down
2 changes: 1 addition & 1 deletion options/posix/include/netinet/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern "C" {
#define IPTOS_THROUGHPUT 0x08
#define IPTOS_RELIABILITY 0x04
#define IPTOS_LOWCOST 0x02
#define IPTOS_LOWDELAY IPTOS_LOWCOST
#define IPTOS_MINCOST IPTOS_LOWCOST
#define IPTOS_CLASS_CS4 0x80
#define IPTOS_CLASS_CS6 0xC0

Expand Down
1 change: 1 addition & 0 deletions sysdeps/managarm/include/abi-bits/vt.h
1 change: 1 addition & 0 deletions sysdeps/managarm/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ if not no_headers
'include/abi-bits/ioctls.h',
'include/abi-bits/xattr.h',
'include/abi-bits/msg.h',
'include/abi-bits/vt.h',
subdir: 'abi-bits',
follow_symlinks: true
)
Expand Down

0 comments on commit 08d7213

Please sign in to comment.