All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Avoid using GNU basename
Date: Wed, 29 Feb 2012 13:51:31 -0500	[thread overview]
Message-ID: <201202291351.32613.vapier@gentoo.org> (raw)
In-Reply-To: <CAHjoi4eR+n=qQ8vZAKwwgLiPSFfrBWHRHwYNvfJn4y0F9EqO7g@mail.gmail.com>

On Tuesday 28 February 2012 10:36:22 Keith Mok wrote:
> There is no GNU basename support in MacOS.
> Use generic POSIX basename defined in libgen.h instead.

alternative: define a non-braindead version in compiler.h:

static const char *_basename(const char *filename)
{   
    const char *p = strrchr(filename, '/');
    return p ? p + 1 : filename;
}

/* Avoid issues with clobbering C library def */
#undef basename
#define basename(x) _basename(x)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120229/c9d26b8c/attachment.pgp>

  reply	other threads:[~2012-02-29 18:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-28 15:36 [U-Boot] [PATCH] Avoid using GNU basename Keith Mok
2012-02-29 18:51 ` Mike Frysinger [this message]
2012-03-02  7:16 ` Wolfgang Denk
2012-03-02 14:09   ` Keith Mok
2012-03-02 16:42     ` Wolfgang Denk
     [not found]       ` <CAHjoi4eRTxXJKwg_XsEvtELNQmDzfqHzZiRO=MY-jfVYvDUrgA@mail.gmail.com>
2012-03-03 16:06         ` Wolfgang Denk
2012-03-02  7:19 ` [U-Boot] [PATCH] mkenvimage: fix usage message Wolfgang Denk
2012-03-02 18:39   ` Mike Frysinger
2012-03-26 11:24   ` Anatolij Gustschin

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=201202291351.32613.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.