Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id C8E28431FBC for ; Sat, 21 Nov 2009 20:17:16 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9UdNpj+Yqq-L for ; Sat, 21 Nov 2009 20:17:16 -0800 (PST) Received: from mail-yx0-f204.google.com (mail-yx0-f204.google.com [209.85.210.204]) by olra.theworths.org (Postfix) with ESMTP id F4122431FAE for ; Sat, 21 Nov 2009 20:17:15 -0800 (PST) Received: by yxe42 with SMTP id 42so4577925yxe.22 for ; Sat, 21 Nov 2009 20:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:to:subject :in-reply-to:references:date:message-id:mime-version:content-type; bh=yeNwB4FeJe5/7H2rWr8QZtO0wSVfjQzwEgyUM00pNng=; b=iio1bEnaYK/H1tVAKs/V4mnKO1xpKQMk+naRBf1TYhDQfGIbwkWWq1c1viBH2CcddW AcfKqBMHNSVGX/FKfZu9k6bqdKEvAp+0O6uzAylhrT7KelyKhqifg3FDz1AwGSM5woOt YV/ciohacsga+6AizLM5R/uzagRzIGfJwkZjA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-type; b=xnoYSrUGqMpDR+FYmHGaEaqBA7x/JN/GkhwVWhadO6H5pC55fsbCY5yZp9NtffhsCo 1ZhIDaWoLoDJYq8Qbwo+6kUUrn6djTXCVuLYiJAvENhbdiV/S+jw3h5ydGLGQMXvaeLG j4nf8rON1N4ahYoKTkuo7ESBV/HioqQV16wo4= Received: by 10.150.71.31 with SMTP id t31mr5879445yba.18.1258863435592; Sat, 21 Nov 2009 20:17:15 -0800 (PST) Received: from fortitudo (70-36-144-85.dsl.dynamic.sonic.net [70.36.144.85]) by mx.google.com with ESMTPS id 15sm1495919gxk.0.2009.11.21.20.17.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 21 Nov 2009 20:17:15 -0800 (PST) Received: from alexbl (uid 1001) (envelope-from alexbl@fortitudo.i-did-not-set--mail-host-address--so-tickle-me) id 70d5 by fortitudo (DragonFly Mail Agent) Sat, 21 Nov 2009 20:17:17 -0800 From: Alexander Botero-Lowry To: Jjgod Jiang , notmuch@notmuchmail.org In-Reply-To: <1258859256-33197-1-git-send-email-gzjjgod@gmail.com> References: <1258859256-33197-1-git-send-email-gzjjgod@gmail.com> Date: Sat, 21 Nov 2009 20:17:17 -0800 Message-ID: <86pr7b9os2.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] [PATCH] Mac OS X compatibility fixes X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 04:17:16 -0000 On Sun, 22 Nov 2009 11:07:36 +0800, Jjgod Jiang wrote: > Add missing GNU extensions strdup() and getline(). The C library > shipped with Mac OS X does not include them (though it does support > some GNU extensions when _GNU_SOURCE is defined), so we have to > add these two. The getline() implementation is a modified version > of getdelim() from GNU Libc. Awesome! > diff --git a/lib/xutil.c b/lib/xutil.c > index 6fa5eb0..805b236 100644 > --- a/lib/xutil.c > +++ b/lib/xutil.c > @@ -79,6 +79,105 @@ xstrdup (const char *s) > return ret; > } > > +#ifdef __APPLE__ Not awesome. This should be done in a capabilites way, for example strndup was added to FreeBSD in 7.2 (which is this current release of the 7 line), and so for older versions of FreeBSD strndup will be needed. getdelim() and getline() came in FreeBSD 8, so they'll be needed for the entire 7 line. So Instead of just assuming __APPLE__ this should be done by determing if the symbols are generally needed. alex