[PATCH 13 of 14] chg: extra the logic opening current directory to opencwdx()

Yuya Nishihara yuya at tcha.org
Thu Apr 14 10:48:39 EDT 2016


On Wed, 13 Apr 2016 17:55:55 +0100, Jun Wu wrote:
> Do you think it's okay to have a marco for all "*x", or "*at" stuff? It will
> make the code shorter. Although I'm not a big fan of macros, I think current
> code duplication is a bit too much and macro can help.

Using macros should be fine if that makes sense.

> And about OS X feature detection. What do you think is the best way to do
> feature detection here? I personally dislike autoconf. But is compiling
> a dummy C program okay? Or should I use "#ifdef SYS_openat"? I think the
> C library and system header may not in sync though.

No idea, and I don't like autoconf, too. It would be too complicated for small
tools like chg.

I think manually-set HAVE_OPENAT macro is good start. Then, we can add a dummy
C program later when we're sure it is the best way.


More information about the Mercurial-devel mailing list