This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
a patch for hyper support in rpcgen
- To: libc-alpha at sources dot redhat dot com
- Subject: a patch for hyper support in rpcgen
- From: atai at jezebel dot dreamhost dot com
- Date: Tue, 3 Apr 2001 16:14:54 -0700
- Cc: atai at atai dot org
Hi, the rpcgen compiler in glibc does not handle the "hyper" types in the XDR
language. "Hyper" is a standard data type, a 64-bit quantity. The following
patch adds this support:
diff -r -u glibc-2.2.3-old/sunrpc/rpc_parse.c glibc-2.2.3/sunrpc/rpc_parse.c
--- glibc-2.2.3-old/sunrpc/rpc_parse.c Mon Feb 16 09:41:53 1998
+++ glibc-2.2.3/sunrpc/rpc_parse.c Tue Apr 3 16:00:05 2001
@@ -621,6 +621,10 @@
*typep = "long";
(void) peekscan (TOK_INT, &tok);
break;
+ case TOK_HYPER:
+ *typep = "int64_t";
+ (void) peekscan(TOK_INT, &tok);
+ break;
case TOK_VOID:
if (dkind != DEF_UNION && dkind != DEF_PROGRAM)
{
@@ -664,6 +668,11 @@
*typep = "u_long";
(void) peekscan (TOK_INT, &tok);
break;
+ case TOK_HYPER:
+ get_token (&tok);
+ *typep = "uint64_t";
+ (void) peekscan(TOK_INT, &tok);
+ break;
case TOK_INT:
get_token (&tok);
*typep = "u_int";
diff -r -u glibc-2.2.3-old/sunrpc/rpc_scan.c glibc-2.2.3/sunrpc/rpc_scan.c
--- glibc-2.2.3-old/sunrpc/rpc_scan.c Sat Jun 19 02:47:43 1999
+++ glibc-2.2.3/sunrpc/rpc_scan.c Tue Apr 3 15:59:30 2001
@@ -440,6 +440,7 @@
{TOK_UNSIGNED, "unsigned"},
{TOK_SHORT, "short"},
{TOK_LONG, "long"},
+ {TOK_HYPER, "hyper"},
{TOK_FLOAT, "float"},
{TOK_DOUBLE, "double"},
{TOK_STRING, "string"},
diff -r -u glibc-2.2.3-old/sunrpc/rpc_scan.h glibc-2.2.3/sunrpc/rpc_scan.h
--- glibc-2.2.3-old/sunrpc/rpc_scan.h Sat Jan 6 20:35:29 2001
+++ glibc-2.2.3/sunrpc/rpc_scan.h Tue Apr 3 15:58:31 2001
@@ -65,6 +65,7 @@
TOK_INT,
TOK_SHORT,
TOK_LONG,
+ TOK_HYPER,
TOK_UNSIGNED,
TOK_FLOAT,
TOK_DOUBLE,