Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Testing latest pari + WASM + node.js... and it works?! Wow.

28485 views
License: GPL3
ubuntu2004
1
/* Copyright (C) 2000 The PARI group.
2
3
This file is part of the PARI/GP package.
4
5
PARI/GP is free software; you can redistribute it and/or modify it under the
6
terms of the GNU General Public License as published by the Free Software
7
Foundation; either version 2 of the License, or (at your option) any later
8
version. It is distributed in the hope that it will be useful, but WITHOUT
9
ANY WARRANTY WHATSOEVER.
10
11
Check the License for details. You should have received a copy of it, along
12
with the package; see the file 'COPYING'. If not, write to the Free Software
13
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
14
15
/* This files contains macros depending on system and compiler */
16
17
#ifdef __cplusplus
18
# define ANYARG ...
19
# define BEGINEXTERN extern "C" {
20
# define ENDEXTERN }
21
#else
22
# define ANYARG
23
# define BEGINEXTERN
24
# define ENDEXTERN
25
#endif
26
27
#ifdef DISABLE_INLINE
28
# undef ASMINLINE
29
#else
30
# ifdef __cplusplus
31
# define INLINE inline static
32
# elif defined(__GNUC__)
33
# define INLINE __inline__ static
34
# endif
35
#endif
36
37
#ifndef DISABLE_VOLATILE
38
# ifdef __GNUC__
39
# define VOLATILE volatile
40
# endif
41
#endif
42
43
#ifndef VOLATILE
44
# define VOLATILE
45
#endif
46
#ifndef INLINE
47
# define INLINE static
48
#endif
49
#ifdef ENABLE_TLS
50
# define THREAD __thread
51
#else
52
# define THREAD
53
#endif
54
55
#if defined(_WIN32) || defined(__CYGWIN32__)
56
/* ANSI C does not allow to longjmp() out of a signal handler, in particular,
57
* the SIGINT handler. On Win32, the handler is executed in another thread, and
58
* longjmp'ing into another thread's stack will utterly confuse the system.
59
* Instead, we check whether win32ctrlc is set in new_chunk(). */
60
BEGINEXTERN
61
extern int win32ctrlc, win32alrm;
62
void dowin32ctrlc(void);
63
ENDEXTERN
64
#define CHECK_CTRLC if (win32ctrlc) dowin32ctrlc();
65
#else
66
#define CHECK_CTRLC
67
#endif
68
69