1 /* Expression evaluation for plural form selection.
2 Copyright (C) 2005-2006, 2015 Free Software Foundation, Inc.
3 Written by Bruno Haible <bruno@clisp.org>, 2005.
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #ifndef _PLURAL_EVAL_H
19 #define _PLURAL_EVAL_H
22 /* Definition of 'struct expression', and
23 declaration of extract_plural_expression() and plural_eval(). */
24 #include "plural-exp.h"
27 /* Protection against signals during plural evaluation. */
31 /* Some platforms don't have the sigjmp_buf type in <setjmp.h>. */
32 #if defined _MSC_VER || defined __MINGW32__
33 /* Native Woe32 API. */
34 # define sigjmp_buf jmp_buf
35 # define sigsetjmp(env,savesigs) setjmp (env)
36 # define siglongjmp longjmp
39 /* We use siginfo to get precise information about the signal.
40 But siginfo doesn't work on Irix 6.5 and on Cygwin 2005. */
41 #if HAVE_SIGINFO && !defined (__sgi) && !defined (__CYGWIN__)
42 # define USE_SIGINFO 1
49 /* Exit point. Must be set before calling install_sigfpe_handler(). */
50 extern sigjmp_buf sigfpe_exit;
53 /* Additional information that is set before sigfpe_exit is invoked. */
54 extern int sigfpe_code;
57 /* Protect against signals during plural evaluation. Must be called around
58 calls to plural_eval(). Must be called in pairs. */
59 extern void install_sigfpe_handler (void);
60 extern void uninstall_sigfpe_handler (void);
67 #endif /* _PLURAL_EVAL_H */