[前][次][番号順一覧][スレッド一覧]

ruby-changes:21552

From: naruse <ko1@a...>
Date: Tue, 1 Nov 2011 13:32:02 +0900 (JST)
Subject: [ruby-changes:21552] naruse:r33601 (trunk): * vsnprintf.c (BSD_vfprintf): support 'll' prefix.

naruse	2011-11-01 13:31:52 +0900 (Tue, 01 Nov 2011)

  New Revision: 33601

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33601

  Log:
    * vsnprintf.c (BSD_vfprintf): support 'll' prefix.
    
    * vsnprintf.c (__sfeof): rename to avoid the collision with NetBSD's
      one.
    
    * vsnprintf.c (__sferror): ditto.
    
    * vsnprintf.c (__sclearerr): ditto.
    
    * vsnprintf.c (__sfileno): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/vsnprintf.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33600)
+++ ChangeLog	(revision 33601)
@@ -1,3 +1,16 @@
+Tue Nov  1 13:14:33 2011  NARUSE, Yui  <naruse@r...>
+
+	* vsnprintf.c (BSD_vfprintf): support 'll' prefix.
+
+	* vsnprintf.c (__sfeof): rename to avoid the collision with NetBSD's
+	  one.
+
+	* vsnprintf.c (__sferror): ditto.
+
+	* vsnprintf.c (__sclearerr): ditto.
+
+	* vsnprintf.c (__sfileno): ditto.
+
 Tue Nov  1 12:36:16 2011  Tanaka Akira  <akr@f...>
 
 	* internal.h (rb_maygvl_fd_fix_cloexec): change the visibility for
Index: vsnprintf.c
===================================================================
--- vsnprintf.c	(revision 33600)
+++ vsnprintf.c	(revision 33601)
@@ -206,20 +206,20 @@
 #define	EOF	(-1)
 
 
-#define	__sfeof(p)	(((p)->_flags & __SEOF) != 0)
-#define	__sferror(p)	(((p)->_flags & __SERR) != 0)
-#define	__sclearerr(p)	((void)((p)->_flags &= ~(__SERR|__SEOF)))
-#define	__sfileno(p)	((p)->_file)
+#define	BSD__sfeof(p)	(((p)->_flags & __SEOF) != 0)
+#define	BSD__sferror(p)	(((p)->_flags & __SERR) != 0)
+#define	BSD__sclearerr(p)	((void)((p)->_flags &= ~(__SERR|__SEOF)))
+#define	BSD__sfileno(p)	((p)->_file)
 
 #undef feof
 #undef ferror
 #undef clearerr
-#define	feof(p)		__sfeof(p)
-#define	ferror(p)	__sferror(p)
-#define	clearerr(p)	__sclearerr(p)
+#define	feof(p)		BSD__sfeof(p)
+#define	ferror(p)	BSD__sferror(p)
+#define	clearerr(p)	BSD__sclearerr(p)
 
 #ifndef _ANSI_SOURCE
-#define	fileno(p)	__sfileno(p)
+#define	fileno(p)	BSD__sfileno(p)
 #endif
 
 
@@ -745,7 +745,16 @@
 		case 'z':
 #endif
 		case 'l':
+#ifdef _HAVE_SANE_QUAD_
+			if (*fmt == 'l') {
+				fmt++;
+				flags |= QUADINT;
+			} else {
+				flags |= LONGINT;
+			}
+#else
 			flags |= LONGINT;
+#endif
 			goto rflag;
 #ifdef _HAVE_SANE_QUAD_
 #if SIZEOF_PTRDIFF_T == SIZEOF_LONG_LONG
@@ -1158,7 +1167,7 @@
 done:
 	FLUSH();
 error:
-	return (__sferror(fp) ? EOF : ret);
+	return (BSD__sferror(fp) ? EOF : ret);
 	/* NOTREACHED */
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]