emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Portability Question


From: Eli Zaretskii
Subject: Re: Portability Question
Date: Wed, 20 May 2020 17:28:37 +0300

> From: Evan Klitzke <address@hidden>
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]