~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to ext/dl/dl.h

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#   include <windows.h>
25
25
#   define dlopen(name,flag) ((void*)LoadLibrary(name))
26
26
#   define dlerror() strerror(rb_w32_map_errno(GetLastError()))
27
 
#   define dlsym(handle,name) ((void*)GetProcAddress(handle,name))
 
27
#   define dlsym(handle,name) ((void*)GetProcAddress((handle),(name)))
28
28
#   define RTLD_LAZY -1
29
29
#   define RTLD_NOW  -1
30
30
#   define RTLD_GLOBAL -1
40
40
    DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,\
41
41
    DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE,DLSTACK_TYPE
42
42
#define DLSTACK_ARGS(stack) \
43
 
    stack[0],stack[1],stack[2],stack[3],stack[4],\
44
 
    stack[5],stack[6],stack[7],stack[8],stack[9],\
45
 
    stack[10],stack[11],stack[12],stack[13],stack[14],\
46
 
    stack[15],stack[16],stack[17],stack[18],stack[19]
 
43
    (stack)[0],(stack)[1],(stack)[2],(stack)[3],(stack)[4],\
 
44
    (stack)[5],(stack)[6],(stack)[7],(stack)[8],(stack)[9],\
 
45
    (stack)[10],(stack)[11],(stack)[12],(stack)[13],(stack)[14],\
 
46
    (stack)[15],(stack)[16],(stack)[17],(stack)[18],(stack)[19]
47
47
 
48
48
#define DLSTACK_PROTO0_ void
49
49
#define DLSTACK_PROTO1_ DLSTACK_TYPE
107
107
#define DLSTACK_PROTO20 DLSTACK_PROTO20_, ...
108
108
 
109
109
#define DLSTACK_ARGS0(stack)
110
 
#define DLSTACK_ARGS1(stack) stack[0]
111
 
#define DLSTACK_ARGS2(stack) DLSTACK_ARGS1(stack), stack[1]
112
 
#define DLSTACK_ARGS3(stack) DLSTACK_ARGS2(stack), stack[2]
113
 
#define DLSTACK_ARGS4(stack) DLSTACK_ARGS3(stack), stack[3]
114
 
#define DLSTACK_ARGS5(stack) DLSTACK_ARGS4(stack), stack[4]
115
 
#define DLSTACK_ARGS6(stack) DLSTACK_ARGS5(stack), stack[5]
116
 
#define DLSTACK_ARGS7(stack) DLSTACK_ARGS6(stack), stack[6]
117
 
#define DLSTACK_ARGS8(stack) DLSTACK_ARGS7(stack), stack[7]
118
 
#define DLSTACK_ARGS9(stack) DLSTACK_ARGS8(stack), stack[8]
119
 
#define DLSTACK_ARGS10(stack) DLSTACK_ARGS9(stack), stack[9]
120
 
#define DLSTACK_ARGS11(stack) DLSTACK_ARGS10(stack), stack[10]
121
 
#define DLSTACK_ARGS12(stack) DLSTACK_ARGS11(stack), stack[11]
122
 
#define DLSTACK_ARGS13(stack) DLSTACK_ARGS12(stack), stack[12]
123
 
#define DLSTACK_ARGS14(stack) DLSTACK_ARGS13(stack), stack[13]
124
 
#define DLSTACK_ARGS15(stack) DLSTACK_ARGS14(stack), stack[14]
125
 
#define DLSTACK_ARGS16(stack) DLSTACK_ARGS15(stack), stack[15]
126
 
#define DLSTACK_ARGS17(stack) DLSTACK_ARGS16(stack), stack[16]
127
 
#define DLSTACK_ARGS18(stack) DLSTACK_ARGS17(stack), stack[17]
128
 
#define DLSTACK_ARGS19(stack) DLSTACK_ARGS18(stack), stack[18]
129
 
#define DLSTACK_ARGS20(stack) DLSTACK_ARGS19(stack), stack[19]
 
110
#define DLSTACK_ARGS1(stack) (stack)[0]
 
111
#define DLSTACK_ARGS2(stack) DLSTACK_ARGS1(stack), (stack)[1]
 
112
#define DLSTACK_ARGS3(stack) DLSTACK_ARGS2(stack), (stack)[2]
 
113
#define DLSTACK_ARGS4(stack) DLSTACK_ARGS3(stack), (stack)[3]
 
114
#define DLSTACK_ARGS5(stack) DLSTACK_ARGS4(stack), (stack)[4]
 
115
#define DLSTACK_ARGS6(stack) DLSTACK_ARGS5(stack), (stack)[5]
 
116
#define DLSTACK_ARGS7(stack) DLSTACK_ARGS6(stack), (stack)[6]
 
117
#define DLSTACK_ARGS8(stack) DLSTACK_ARGS7(stack), (stack)[7]
 
118
#define DLSTACK_ARGS9(stack) DLSTACK_ARGS8(stack), (stack)[8]
 
119
#define DLSTACK_ARGS10(stack) DLSTACK_ARGS9(stack), (stack)[9]
 
120
#define DLSTACK_ARGS11(stack) DLSTACK_ARGS10(stack), (stack)[10]
 
121
#define DLSTACK_ARGS12(stack) DLSTACK_ARGS11(stack), (stack)[11]
 
122
#define DLSTACK_ARGS13(stack) DLSTACK_ARGS12(stack), (stack)[12]
 
123
#define DLSTACK_ARGS14(stack) DLSTACK_ARGS13(stack), (stack)[13]
 
124
#define DLSTACK_ARGS15(stack) DLSTACK_ARGS14(stack), (stack)[14]
 
125
#define DLSTACK_ARGS16(stack) DLSTACK_ARGS15(stack), (stack)[15]
 
126
#define DLSTACK_ARGS17(stack) DLSTACK_ARGS16(stack), (stack)[16]
 
127
#define DLSTACK_ARGS18(stack) DLSTACK_ARGS17(stack), (stack)[17]
 
128
#define DLSTACK_ARGS19(stack) DLSTACK_ARGS18(stack), (stack)[18]
 
129
#define DLSTACK_ARGS20(stack) DLSTACK_ARGS19(stack), (stack)[19]
130
130
 
131
131
extern VALUE rb_mDL;
132
132
extern VALUE rb_cDLHandle;
156
156
#define ALIGN_DOUBLE (sizeof(s_double) - sizeof(double))
157
157
 
158
158
#define DLALIGN(ptr,offset,align) {\
159
 
  while( (((unsigned long)((char *)ptr + offset)) % align) != 0 ) offset++;\
 
159
  while( (((unsigned long)((char *)(ptr) + (offset))) % (align)) != 0 ) (offset)++;\
160
160
}
161
161
 
162
162
 
182
182
# define NUM2PTR(x)   ((void*)(NUM2ULL(x)))
183
183
#endif
184
184
 
185
 
#define BOOL2INT(x)  ((x == Qtrue)?1:0)
186
 
#define INT2BOOL(x)  (x?Qtrue:Qfalse)
 
185
#define BOOL2INT(x)  (((x) == Qtrue)?1:0)
 
186
#define INT2BOOL(x)  ((x)?Qtrue:Qfalse)
187
187
 
188
188
typedef void (*freefunc_t)(void*);
189
189