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

Re: coding style: #ifdef blocks and real C blocks

From
Tay Ray Chuan <rctay89@gmail.com>
Date
Mar 1, 2009, 09:33 UTC
Message-ID
<be6fef0d0903010133s7343a96ekd8939695a65ba4a2@mail.gmail.com>
In-Reply-To
<7vbpsl8v7r.fsf@gitster.siamese.dyndns.org>
On Sun, Mar 1, 2009 at 5:10 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
>    #ifdef USE_CURL_MULTI
>    #define active_slot_get get_active_multi_slot
>    #else
>    #define active_slot_get get_active_slot
>    #endif
>
> so that the code itself would not have to have any #ifdef?

On further thought, wouldn't it be a better idea to make this uppercase, ie. GET_ACTIVE_SLOT, to make it more obvious this is a macro? Then we wouldn't have to jumble the name into "active_slot_get" to differentiate it from the two slot functions.

-- 
Cheers,
Ray Chuan
Previous: Tay Ray Chuan
Message 4 of 4 in “coding style: #ifdef blocks and real C blocks”
  1. Tay Ray ChuanMar 1, 2009
  2. Junio C HamanoMar 1, 2009
  3. Tay Ray ChuanMar 1, 2009
  4. Tay Ray ChuanMar 1, 2009

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.