git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Witten <mfwitten@gmail.com>
To: Erik Faye-Lund <kusmabite@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC 2/2] Future Proofing: Pass around pointers to either functions or data
Date: Wed, 30 Mar 2011 15:02:28 +0000	[thread overview]
Message-ID: <429c193b-6bc6-4f13-bd69-af113a4bd145-mfwitten@gmail.com> (raw)
In-Reply-To: <AANLkTi=nxA0BrLruQ9zc_SajH2ghpZX14Ra7QOo9fMBx@mail.gmail.com>

On Wed, 30 Mar 2011 12:09:46 +0200, Erik Faye-Lund <kusmabite@gmail.com> wrote:
> On Tue, Mar 29, 2011 at 5:28 PM, Michael Witten <mfwitten@gmail.com> wrote:
>> +#define ALT_ODB_FN_INFO_FUNC(variable, function) \
>> +       union alt_odb_fn_info variable = { \
>> +               .func = (alt_odb_fn_cb)function \
>> +       }
>> +#define ALT_ODB_FN_INFO_DATA(variable, data_) \
>> +       union alt_odb_fn_info variable = { \
>> +               .data = data_ \
>> +       }
>
> We try to stay away from C99 features like this, as it doesn't work on
> all compilers we target.

How about changing it to this:

#define ALT_ODB_FN_INFO_FUNC(variable, function) \
	union alt_odb_fn_info variable; do { \
		variable.func = (alt_odb_fn_cb)function; \
	} while (0)
#define ALT_ODB_FN_INFO_DATA(variable, data_) \
	union alt_odb_fn_info variable; do { \
		variable.data = data_ \
	} while (0)

  reply	other threads:[~2011-03-30 15:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29 15:28 [RFC 2/2] Future Proofing: Pass around pointers to either functions or data Michael Witten
2011-03-29 15:02 ` [RFC 1/2] Portability: Convert strictly between function pointers Michael Witten
2011-03-30 10:09 ` [RFC 2/2] Future Proofing: Pass around pointers to either functions or data Erik Faye-Lund
2011-03-30 15:02   ` Michael Witten [this message]
2011-03-30 19:41   ` Junio C Hamano
2011-03-30 21:40 ` [RFC 0/3] Alternates API Michael Witten
2011-03-30 21:24   ` [RFC 2/3] Alternates API: Improve naming Michael Witten
2011-03-30 21:28     ` [RFC 3/3] Alternates API: Remove unused parameter Michael Witten
2011-03-30 20:43       ` [RFC 1/3] Alternates API: Untangle the interface Michael Witten
2011-03-30 22:28         ` Junio C Hamano
2011-03-30 22:46       ` [RFC 3/3] Alternates API: Remove unused parameter Junio C Hamano
2011-03-30 22:31     ` [RFC 2/3] Alternates API: Improve naming Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=429c193b-6bc6-4f13-bd69-af113a4bd145-mfwitten@gmail.com \
    --to=mfwitten@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kusmabite@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).