-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.h
More file actions
38 lines (28 loc) · 999 Bytes
/
common.h
File metadata and controls
38 lines (28 loc) · 999 Bytes
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
/*
Copyright © 2020 浅倉麗子
This file is part of Quick Menu Plus
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef COMMON_H
#define COMMON_H
#define USED __attribute__ ((used))
#define UNUSED __attribute__ ((unused))
#define GLZ(x) do {\
if ((x) < 0) { goto fail; }\
} while (0)
#define RLZ(x) do {\
__typeof__(x) __ret__ = (x);\
if (__ret__ < 0) { return __ret__; }\
} while(0)
#define RNE(x, k) do {\
if ((x) != (k)) { return -1; }\
} while(0)
#endif