Skip to content

Commit 3642a61

Browse files
author
Giloo
committed
test for windows' portable xdr
1 parent 7431abd commit 3642a61

File tree

2 files changed

+22
-64
lines changed

2 files changed

+22
-64
lines changed

src/typedefs.hpp

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -138,34 +138,15 @@ typedef unsigned long ULong;
138138

139139
// convenient naming
140140
typedef unsigned char DByte;
141-
// typedef int DInt;
142-
// typedef unsigned int DUInt;
143-
// typedef long int DLong;
144-
// typedef unsigned long int DULong;
145141

146-
#ifdef _MSC_VER
147-
typedef __int64 DLong64;
148-
typedef unsigned __int64 DULong64;
149-
150-
#else
151-
//typedef long int DLong64;
152-
//typedef unsigned long int DULong64;
142+
//#ifdef _MSC_VER
143+
//typedef long long DLong64;
144+
//typedef unsigned long long DULong64;
145+
//
146+
//#else
153147
typedef long long int DLong64;
154148
typedef unsigned long long int DULong64;
155-
#endif
156-
157-
#ifdef USE_MPFR
158-
159-
typedef __int128 DLong128;
160-
typedef unsigned __int128 DULong128;
161-
162-
typedef long double DLDouble;
163-
typedef std::complex<DLDouble> DComplexLDbl;
164-
165-
166-
typedef mpfr::mpreal DArbitrary;
167-
#endif
168-
149+
//#endif
169150

170151
typedef short DInt;
171152
typedef unsigned short DUInt;
@@ -179,6 +160,18 @@ typedef DPtr DObj; // ptr to object heap
179160
typedef std::complex<DFloat> DComplex;
180161
typedef std::complex<DDouble> DComplexDbl;
181162

163+
#ifdef USE_MPFR
164+
165+
typedef __int128 DLong128;
166+
typedef unsigned __int128 DULong128;
167+
168+
typedef long double DLDouble;
169+
typedef std::complex<DLDouble> DComplexLDbl;
170+
171+
172+
typedef mpfr::mpreal DArbitrary;
173+
#endif
174+
182175
// list of identifiers (used in several places)
183176
typedef std::vector<std::string> IDList;
184177
typedef std::vector<std::string> StrArr;

src/xdr.h

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,6 @@ typedef struct __rpc_xdr {
123123
/* free privates of this xdr_stream */
124124
void (*x_destroy)(struct __rpc_xdr *);
125125
bool_t (*x_control)(struct __rpc_xdr *, int, void *);
126-
// bool_t (*x_getlong)(); /* get a long from underlying stream */
127-
// bool_t (*x_putlong)(); /* put a long to " */
128-
// bool_t (*x_getbytes)();/* get some bytes from " */
129-
// bool_t (*x_putbytes)();/* put some bytes to " */
130-
// u_int (*x_getpostn)();/* returns bytes off from beginning */
131-
// bool_t (*x_setpostn)();/* lets you reposition the stream */
132-
// long * (*x_inline)(); /* buf quick ptr to buffered data */
133-
// void (*x_destroy)(); /* free privates of this xdr_stream */
134126
} *x_ops;
135127
caddr_t x_public; /* users' data */
136128
caddr_t x_private; /* pointer to private data */
@@ -206,7 +198,7 @@ struct xdr_discrim {
206198
};
207199

208200
/*
209-
* In-line routines for fast encode/decode of primitve data types.
201+
* In-line routines for fast encode/decode of primitive data types.
210202
* Caveat emptor: these use single memory cycles to get the
211203
* data from the underlying buffer, and will fail to operate
212204
* properly if the data is not aligned. The standard way to use these
@@ -263,31 +255,12 @@ extern bool_t xdr_double(XDR *, double *);
263255
extern bool_t xdr_reference(XDR *, char **, u_int, xdrproc_t);
264256
extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t);
265257
extern bool_t xdr_wrapstring(XDR *, char **);
258+
extern bool_t xdr_uint64_t (XDR *xdrs, uint64_t *uip);
259+
extern bool_t xdr_int64_t (XDR *xdrs, int64_t *uip);
266260
#ifdef __cplusplus
267261
}
268262
#endif
269-
//extern bool_t xdr_void();
270-
//extern bool_t xdr_int();
271-
//extern bool_t xdr_u_int();
272-
//extern bool_t xdr_long();
273-
//extern bool_t xdr_u_long();
274-
//extern bool_t xdr_short();
275-
//extern bool_t xdr_u_short();
276-
//extern bool_t xdr_bool();
277-
//extern bool_t xdr_enum();
278-
//extern bool_t xdr_array();
279-
//extern bool_t xdr_bytes();
280-
//extern bool_t xdr_opaque();
281-
//extern bool_t xdr_string();
282-
//extern bool_t xdr_union();
283-
//extern bool_t xdr_char();
284-
//extern bool_t xdr_u_char();
285-
//extern bool_t xdr_vector();
286-
//extern bool_t xdr_float();
287-
//extern bool_t xdr_double();
288-
//extern bool_t xdr_reference();
289-
//extern bool_t xdr_pointer();
290-
//extern bool_t xdr_wrapstring();
263+
291264
/*
292265
* Common opaque bytes objects used by many rpc protocols;
293266
* declared here due to commonality.
@@ -329,17 +302,9 @@ extern bool_t xdrrec_eof(XDR *);
329302
#ifdef __cplusplus
330303
}
331304
#endif
332-
//extern void xdrmem_create(); /* XDR using memory buffers */
333-
//extern void xdrstdio_create(); /* XDR using stdio library */
334-
//extern void xdrrec_create(); /* XDR pseudo records for tcp */
335-
//extern bool_t xdrrec_endofrecord(); /* make end of xdr record */
336-
//extern bool_t xdrrec_skiprecord(); /* move to beginning of next record */
337-
//extern bool_t xdrrec_eof(); /* true if no more input */
338305

339306
/* RWMJ */
340307
extern void xdr_free (xdrproc_t, char *);
341-
extern bool_t xdr_uint64_t (XDR *xdrs, uint64_t *uip);
342-
extern bool_t xdr_int64_t (XDR *xdrs, int64_t *uip);
343308

344309
#define xdr_u_quad_t xdr_uint64_t
345310
#define xdr_quad_t xdr_int64_t

0 commit comments

Comments
 (0)