~peter-pearse/ubuntu/natty/guile-1.8/prop001

« back to all changes in this revision

Viewing changes to libguile/discouraged.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-06-04 19:01:38 UTC
  • mfrom: (8.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090604190138-1ao3t6sj31cqvcfe
Tags: 1.8.6+1-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Build with -Wno-error.
  - Build with thread support. Some guile-using programs like autogen need it.
  - Add debian/guile-1.8-libs.shlibs: Thread support breaks ABI, bump the soname.
* Dropped changes:
  - libltdl3-dev -> libltdl7-dev: current libltdl-dev Provides: both.
  - debian/patches/libtool-ftbfs.diff: integrated upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
   discourage something, move it here when that is feasible.
3
3
*/
4
4
 
5
 
/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
 
5
/* Copyright (C) 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
6
6
 *
7
7
 * This library is free software; you can redistribute it and/or
8
8
 * modify it under the terms of the GNU Lesser General Public
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
20
 */
21
21
 
22
 
#include "libguile.h"
 
22
#ifdef HAVE_CONFIG_H
 
23
#  include <config.h>
 
24
#endif
 
25
 
 
26
#include <libguile.h>
 
27
 
23
28
 
24
29
#if (SCM_ENABLE_DISCOURAGED == 1)
25
30
 
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);
 
31
SCM
 
32
scm_short2num (short x)
 
33
{
 
34
  return scm_from_short (x);
 
35
}
 
36
 
 
37
SCM
 
38
scm_ushort2num (unsigned short x)
 
39
{
 
40
  return scm_from_ushort (x);
 
41
}
 
42
 
 
43
SCM
 
44
scm_int2num (int x)
 
45
{
 
46
  return scm_from_int (x);
 
47
}
 
48
 
 
49
SCM
 
50
scm_uint2num (unsigned int x)
 
51
{
 
52
  return scm_from_uint (x);
 
53
}
 
54
 
 
55
SCM
 
56
scm_long2num (long x)
 
57
{
 
58
  return scm_from_long (x);
 
59
}
 
60
 
 
61
SCM
 
62
scm_ulong2num (unsigned long x)
 
63
{
 
64
  return scm_from_ulong (x);
 
65
}
 
66
 
 
67
SCM
 
68
scm_size2num (size_t x)
 
69
{
 
70
  return scm_from_size_t (x);
 
71
}
 
72
 
 
73
SCM
 
74
scm_ptrdiff2num (ptrdiff_t x)
 
75
{
 
76
  return scm_from_ssize_t (x);
 
77
}
 
78
 
 
79
short
 
80
scm_num2short (SCM x, unsigned long pos, const char *s_caller)
 
81
{
 
82
  return scm_to_short (x);
 
83
}
 
84
 
 
85
unsigned short
 
86
scm_num2ushort (SCM x, unsigned long pos, const char *s_caller)
 
87
{
 
88
  return scm_to_ushort (x);
 
89
}
 
90
 
 
91
int
 
92
scm_num2int (SCM x, unsigned long pos, const char *s_caller)
 
93
{
 
94
  return scm_to_int (x);
 
95
}
 
96
 
 
97
unsigned int
 
98
scm_num2uint (SCM x, unsigned long pos, const char *s_caller)
 
99
{
 
100
  return scm_to_uint (x);
 
101
}
 
102
 
 
103
long
 
104
scm_num2long (SCM x, unsigned long pos, const char *s_caller)
 
105
{
 
106
  return scm_to_long (x);
 
107
}
 
108
 
 
109
unsigned long
 
110
scm_num2ulong (SCM x, unsigned long pos, const char *s_caller)
 
111
{
 
112
  return scm_to_ulong (x);
 
113
}
 
114
 
 
115
size_t
 
116
scm_num2size (SCM x, unsigned long pos, const char *s_caller)
 
117
{
 
118
  return scm_to_size_t (x);
 
119
}
 
120
 
 
121
ptrdiff_t
 
122
scm_num2ptrdiff (SCM x, unsigned long pos, const char *s_caller)
 
123
{
 
124
  return scm_to_ssize_t (x);
 
125
}
47
126
 
48
127
#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);
 
128
 
 
129
SCM
 
130
scm_long_long2num (long long x)
 
131
{
 
132
  return scm_from_long_long (x);
 
133
}
 
134
 
 
135
SCM
 
136
scm_ulong_long2num (unsigned long long x)
 
137
{
 
138
  return scm_from_ulong_long (x);
 
139
}
 
140
 
 
141
long long
 
142
scm_num2long_long (SCM x, unsigned long pos, const char *s_caller)
 
143
{
 
144
  return scm_to_long_long (x);
 
145
}
 
146
 
 
147
unsigned long long
 
148
scm_num2ulong_long (SCM x, unsigned long pos, const char *s_caller)
 
149
{
 
150
  return scm_to_ulong_long (x);
 
151
}
 
152
 
53
153
#endif
54
154
 
55
155
SCM