[m-rev.] diff: .NET back-end: implement char__max_value

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Feb 16 09:41:52 AEDT 2003


Estimated hours taken: 0.5
Branches: main

library/char.m:
	Implement char__max_char_value for .NET.

Workspace: /home/fjh/ws/hermes
Index: library/char.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/char.m,v
retrieving revision 1.39
diff -u -d -r1.39 char.m
--- library/char.m	23 Oct 2002 05:31:33 -0000	1.39
+++ library/char.m	15 Feb 2003 22:40:57 -0000
@@ -489,6 +489,17 @@
 		[will_not_call_mercury, promise_pure, thread_safe], "
 	Max = UCHAR_MAX;
 ").
+:- pragma foreign_proc("C#",
+		char__max_char_value(Max::out),
+		[will_not_call_mercury, promise_pure, thread_safe], "
+	// .NET uses 16-bit 'Unicode'.  This might be either UCS-2,
+	// where Unicode characters that don't fit in 16 bits are encoded
+	// in two 16 bit characters, or it might be just the 16-bit subset,
+	// i.e. only the Unicode characters that fit in 16 bits.
+	// For our purposes, it doesn't matter.
+	Max = 0xffff;
+").
+
 
 char__max_char_value(_) :-
 	% This version is only used for back-ends for which there is no

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list