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

ruby-changes:63788

From: Nobuyoshi <ko1@a...>
Date: Sat, 28 Nov 2020 18:48:53 +0900 (JST)
Subject: [ruby-changes:63788] 3db21cf25f (master): Revived the getenv macro for dln_find.c

https://git.ruby-lang.org/ruby.git/commit/?id=3db21cf25f

From 3db21cf25f9c0830fafd9f72f228826515a5b566 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 28 Nov 2020 18:39:57 +0900
Subject: Revived the getenv macro for dln_find.c

This partially reverts commit "Windows: Improve readablity of
getenv() encoding" 14453a256d58b11b06d432e2a4388d95aac298d6.

The `getenv` macro defined here is to also substitute the function
in dln_find.c, not only in this file.

diff --git a/win32/win32.c b/win32/win32.c
index 602fba4..17449fa 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -71,9 +71,13 @@ static int w32_stati128(const char *path, struct stati128 *st, UINT cp, BOOL lst https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L71
 static char *w32_getenv(const char *name, UINT cp);
 
 #undef getenv
+/*
+ * Do not remove the macros to substitute functions in dln_find.c.
+ */
 #define DLN_FIND_EXTRA_ARG_DECL ,UINT cp
 #define DLN_FIND_EXTRA_ARG ,cp
 #define rb_w32_stati128(path, st) w32_stati128(path, st, cp, FALSE)
+#define getenv(name) w32_getenv(name, cp)
 #undef CharNext
 #define CharNext(p) CharNextExA(cp, (p), 0)
 #define dln_find_exe_r rb_w32_udln_find_exe_r
-- 
cgit v0.10.2


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

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