git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Remove gitenv macro hack

From
DWDan Weber <dan@mirrorlynx.com>
Date
May 19, 2005, 22:01 UTC
Message-ID
<Pine.LNX.4.62.0505191800280.16809@mirrorlynx.com>

Removed hacky macro for gitenv. Often produced warnings by the compiler for the use of ?: without anything after the ?

Signed-off-by: Dan Weber <dan@mirrorlynx.com>

--- commit 1b48b369a152a6315a9b4e6eebf50f56176cdd82 tree 53c238f3aa788df47325c456ab16b0eb25004074 parent 5cd4c7b7686d334e341b21d92449349feda3ef65 author Dan Weber <dan@mirrorlynx.com> Thu, 19 May 2005 17:57:44 -0400 committer Dan Weber <dan@mirrorlynx.com> Thu, 19 May 2005 17:57:44 -0400

  cache.h |    8 +++++++-
  1 files changed, 7 insertions(+), 1 deletion(-)
Index: cache.h
===================================================================
--- ca5fef50fb68a3afbb35e1a48ac622f7a964f021/cache.h  (mode:100644)
+++ 53c238f3aa788df47325c456ab16b0eb25004074/cache.h  (mode:100644)
@@ -37,7 +37,13 @@
   * We accept older names for now but warn.
   */
  extern char *gitenv_bc(const char *);
-#define gitenv(e) (getenv(e) ? : gitenv_bc(e))
+static inline char* gitenv(const char* name) {
+       char* result = getenv(name);
+       if (result)
+               return result;
+       else
+               return gitenv_bc(name);
+}

  /*
   * Basic data structures for the directory cache
Next: Junio C Hamano
Message 1 of 2 in “Remove gitenv macro hack”
  1. Remove gitenv macro hackDan Weber, May 19, 2005
  2. Junio C HamanoMay 19, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.