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

ruby-changes:33938

From: nobu <ko1@a...>
Date: Mon, 19 May 2014 21:32:33 +0900 (JST)
Subject: [ruby-changes:33938] nobu:r46019 (trunk): etc.c: old VC

nobu	2014-05-19 21:32:25 +0900 (Mon, 19 May 2014)

  New Revision: 46019

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

  Log:
    etc.c: old VC
    
    * ext/etc/etc.c (etc_uname): fix for old VC.

  Modified files:
    trunk/ext/etc/etc.c
Index: ext/etc/etc.c
===================================================================
--- ext/etc/etc.c	(revision 46018)
+++ ext/etc/etc.c	(revision 46019)
@@ -702,7 +702,11 @@ etc_uname(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ext/etc/etc.c#L702
 			 rb_w32_conv_from_wchar(v.szCSDVersion, rb_utf8_encoding()));
     rb_hash_aset(result, ID2SYM(rb_intern("version")), version);
 
+# if defined _MSC_VER && _MSC_VER < 1300
+#   define GET_COMPUTER_NAME(ptr, plen) GetComputerNameW(ptr, plen)
+# else
 #   define GET_COMPUTER_NAME(ptr, plen) GetComputerNameExW(ComputerNameDnsFullyQualified, ptr, len);
+# endif
     GET_COMPUTER_NAME(NULL, &len);
     buf = ALLOCV_N(WCHAR, vbuf, len);
     if (GET_COMPUTER_NAME(buf, &len)) {
@@ -712,6 +716,15 @@ etc_uname(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ext/etc/etc.c#L716
     if (NIL_P(nodename)) nodename = rb_str_new(0, 0);
     rb_hash_aset(result, ID2SYM(rb_intern("nodename")), nodename);
 
+# ifndef PROCESSOR_ARCHITECTURE_AMD64
+#   define PROCESSOR_ARCHITECTURE_AMD64 9
+# endif
+# ifndef PROCESSOR_ARCHITECTURE_IA64
+#   define PROCESSOR_ARCHITECTURE_IA64 6
+# endif
+# ifndef PROCESSOR_ARCHITECTURE_INTEL
+#   define PROCESSOR_ARCHITECTURE_INTEL 0
+# endif
     GetSystemInfo(&s);
     switch (s.wProcessorArchitecture) {
       case PROCESSOR_ARCHITECTURE_AMD64:

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

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