Commit | Line | Data |
---|---|---|
c71b0706 MV |
1 | /* This file contains definitions for discouraged features. When you |
2 | discourage something, move it here when that is feasible. | |
3 | */ | |
4 | ||
5 | /* Copyright (C) 2003 Free Software Foundation, Inc. | |
6 | * | |
7 | * This library is free software; you can redistribute it and/or | |
8 | * modify it under the terms of the GNU Lesser General Public | |
9 | * License as published by the Free Software Foundation; either | |
10 | * version 2.1 of the License, or (at your option) any later version. | |
11 | * | |
12 | * This library is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * Lesser General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU Lesser General Public | |
18 | * License along with this library; if not, write to the Free Software | |
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
20 | */ | |
21 | ||
22 | #include "libguile.h" | |
23 | ||
24 | #if (SCM_ENABLE_DISCOURAGED == 1) | |
25 | ||
26 | #define DEFFROM(t,f1,f2) SCM f1(t x) { return f2 (x); } | |
27 | #define DEFTO(t,f1,f2) t f1(SCM x, unsigned long pos, const char *s_caller) \ | |
28 | { return f2 (x); } | |
29 | ||
30 | DEFFROM (short, scm_short2num, scm_from_short); | |
31 | DEFFROM (unsigned short, scm_ushort2num, scm_from_ushort); | |
32 | DEFFROM (int, scm_int2num, scm_from_int); | |
33 | DEFFROM (unsigned int, scm_uint2num, scm_from_uint); | |
34 | DEFFROM (long, scm_long2num, scm_from_long); | |
35 | DEFFROM (unsigned long, scm_ulong2num, scm_from_ulong); | |
36 | DEFFROM (size_t, scm_size2num, scm_from_size_t); | |
37 | DEFFROM (ptrdiff_t, scm_ptrdiff2num, scm_from_ssize_t); | |
38 | ||
39 | DEFTO (short, scm_num2short, scm_to_short); | |
40 | DEFTO (unsigned short, scm_num2ushort, scm_to_ushort); | |
41 | DEFTO (int, scm_num2int, scm_to_int); | |
42 | DEFTO (unsigned int, scm_num2uint, scm_to_uint); | |
43 | DEFTO (long, scm_num2long, scm_to_long); | |
44 | DEFTO (unsigned long, scm_num2ulong, scm_to_ulong); | |
45 | DEFTO (size_t, scm_num2size, scm_to_size_t); | |
46 | DEFTO (ptrdiff_t, scm_num2ptrdiff, scm_to_ssize_t); | |
47 | ||
48 | #if SCM_SIZEOF_LONG_LONG != 0 | |
49 | DEFFROM (long long, scm_long_long2num, scm_from_long_long); | |
50 | DEFFROM (unsigned long long, scm_ulong_long2num, scm_from_ulong_long); | |
51 | DEFTO (long long, scm_num2long_long, scm_to_long_long); | |
52 | DEFTO (unsigned long long, scm_num2ulong_long, scm_to_ulong_long); | |
53 | #endif | |
54 | ||
55 | ||
56 | void | |
57 | scm_i_init_discouraged (void) | |
58 | { | |
59 | #include "libguile/discouraged.x" | |
60 | } | |
61 | ||
62 | #endif |