-
Notifications
You must be signed in to change notification settings - Fork 0
/
max.h
63 lines (55 loc) · 1.84 KB
/
max.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
51
52
53
54
55
56
57
58
59
60
61
62
63
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* max.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lgasc <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/10 18:40:07 by lgasc #+# #+# */
/* Updated: 2024/03/11 20:28:19 by lgasc ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MAX_H
# define MAX_H
//# include <stddef.h>
//# include "libft.h"
enum e_max_code
{
Max_Ok,
Max_NullPointer,
Max_NoElement
};
// Indeed, `clang` seems to support no attribute...
# ifndef __clang__
# ifdef TEST
typedef struct __attribute__ ((designated_init)) s_max_result
{
enum e_max_code code;
union
{
size_t ok;
};
} t_max_result;
# define MAX_H_ATTRIBUTES
# endif
# endif
# ifndef MAX_H_ATTRIBUTES
typedef struct s_max_result
{
enum e_max_code code;
union
{
size_t ok;
};
} t_max_result;
# endif
void ft_umaxo(const unsigned int integers[], size_t length)
;//__attribute_warn_unused_result__;
unsigned long ft_ulmaxo(const unsigned long array[], size_t length)
__attribute__ ((warn_unused_result));
size_t ft_zmaxo(const size_t array[], size_t length)
__attribute__ ((warn_unused_result));
t_max_result ft_try_zmaxo(const size_t array[], size_t length)
__attribute__ ((warn_unused_result));
size_t ft_zmax(size_t a, size_t b);
#endif