all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Evan Klitzke <evan@eklitzke.org>
Cc: Emacs-devel@gnu.org
Subject: Re: Portability Question
Date: Wed, 20 May 2020 17:28:37 +0300	[thread overview]
Message-ID: <83imgq7ka2.fsf@gnu.org> (raw)
In-Reply-To: <87k117e1it.fsf@eklitzke.org> (message from Evan Klitzke on Tue,  19 May 2020 20:19:38 -0700)

> From: Evan Klitzke <evan@eklitzke.org>
> Date: Tue, 19 May 2020 20:19:38 -0700
> 
> I am (hopefully) a new Emacs contributor and I started working on some 
> changes to Emacs that I would like to contribute as patches, and I have 
> some questions about writing platform specific code in Emacs. I'm adding 
> new code in sysdep.c and want to know the best practices.

Thank you for working on Emacs development.

Please note that sysdep.c is not the only place for platform-dependent
code, it depends on what the proposed code will do.  If you are
unsure, please feel free to ask more questions.

> The first question I have is which standard POSIX headers it's safe to 
> assume are available. The reason I ask this is that sysdep.c already 
> includes <unistd.h> without a HAVE_UNISTD_H check, which implies to me 
> that there's already a requirement on having POSIX headers available 
> (i.e. I assume on Windows Cygwin is required to build?). But, somewhat 
> confusingly, when sysdep.c includes <pwd.h> it uses a HAVE_PWD_H guard, 
> even though this is a standard POSIX header.

My advice is not to be bothered by that too much.  Use your best
judgment, and we will tell you if some changes are needed when we
review the patches.

> Another question I have is: in practice, which build configurations for 
> Emacs are likely to link against glibc vs another libc

In general, only GNU/Linux platforms use glibc.

> The reason I'm asking is if I opportunistically want to use a glibc
> extension and fallback to something that works but is hacky if glibc
> isn't available, I'm wondering in practice which build
> configurations will have to use the hacky fallback path.

Features that are not necessarily available outside of glibc should
either require some Gnulib module to replace them, or need fallback
code activated by configure-time test.

Thanks.



      parent reply	other threads:[~2020-05-20 14:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-20  3:19 Portability Question Evan Klitzke
2020-05-20 11:29 ` Stefan Monnier
2020-05-20 14:28 ` Eli Zaretskii [this message]

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=83imgq7ka2.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=Emacs-devel@gnu.org \
    --cc=evan@eklitzke.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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.