Fix cross compilation (e.g. on Darwin). Following changes to make.tmpl,
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / trig.h
blobf19617c90f568af93922b8b16e524dca1951a9f4
1 /* trig.h - Trigonometric function support. */
2 /*
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2008 Free Software Foundation, Inc.
6 * GRUB is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GRUB is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef GRUB_TRIG_HEADER
21 #define GRUB_TRIG_HEADER 1
23 #define GRUB_TRIG_ANGLE_MAX 256
24 #define GRUB_TRIG_ANGLE_MASK 255
25 #define GRUB_TRIG_FRACTION_SCALE 16384
27 extern const short grub_trig_sintab[];
28 extern const short grub_trig_costab[];
30 static __inline int
31 grub_sin (int x)
33 x &= GRUB_TRIG_ANGLE_MASK;
34 return grub_trig_sintab[x];
37 static __inline int
38 grub_cos (int x)
40 x &= GRUB_TRIG_ANGLE_MASK;
41 return grub_trig_costab[x];
44 #endif /* ! GRUB_TRIG_HEADER */