-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstdlib.h
50 lines (36 loc) · 763 Bytes
/
stdlib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2022 Mark Seminatore. All rights reserved.
#ifndef __STDLIB_H
#define __STDLIB_H
#include "rtconfig.h"
#include "stddef.h"
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
#if defined(__clang__)
# define NORETURN __attribute__((noreturn))
#else
# define NORETURN __declspec(noreturn)
#endif
#ifdef INC_DIV
typedef struct div_t
{
int quot;
int rem;
} div_t;
div_t div(int numer, int denom);
#endif
#ifdef INC_LDIV
typedef struct ldiv_t
{
long quot;
long rem;
} ldiv_t;
ldiv_t ldiv(long int numer, long int denom);
#endif
NORETURN void exit(int status);
NORETURN void abort(void);
int atoi(const char *str);
void free(void *ptr);
void *malloc(size_t size);
int abs(int x);
long int labs(long int x);
#endif // __STDLIB_H