From: Eli Zaretskii <eliz@gnu.org>
To: Ken Brown <kbrown@cornell.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Adding battery support on Cygwin
Date: Sat, 13 Jan 2018 10:11:22 +0200 [thread overview]
Message-ID: <83tvvq18lx.fsf@gnu.org> (raw)
In-Reply-To: <302136d9-0b2e-222e-502d-2db8f7de5992@cornell.edu> (message from Ken Brown on Fri, 12 Jan 2018 21:33:33 -0500)
> From: Ken Brown <kbrown@cornell.edu>
> Date: Fri, 12 Jan 2018 21:33:33 -0500
>
> The Cygwin-w32 currently supports battery status via the function
> w32fns.c:Fw32_battery_status. The X11 and nox builds don't have this
> support, and Cygwin lacks the facilities used on unix-like systems to
> provide it (/proc/apm, etc.). But it turns out to be easy to compile
> and use Fw32_battery_status on all Cygwin builds, simply by pulling it
> out of w32fns.c into a new file.
>
> The attached patch does this. OK to push?
Yes, but see some comments below.
> If so, to which branch?
Master, of course. And please add a NEWS entry.
> * src/w32fns.c (Fw32_battery_status): Move to a new file,
> src/w32battery.c.
Let's use a better name, because this feature is not the last one to
be used both in the w32 and Cygwin/X builds. How about w32common.c?
Or, if this is too similar to the (unrelated) w32common.h, how about
w32cygwinx.c (since cygw32.c is already taken)?
> * src/w32battery.h: New file, containing prototype of
> syms_of_w32battery.
We don't need a new header file just to have a single prototype in
it. You can put this prototype in lisp.h (we already have quite a few
of syms_of_* there).
> +if test "${HAVE_W32}" = "no" && test "${opsys}" = "cygwin"; then
> + W32_LIBS="$W32_LIBS -lkernel32"
> + W32_OBJ="$W32_OBJ w32battery.o"
> +fi
This looks like W32_OBJ and W32_LIBS have some values in the Cygwin
non-w32 build, but AFAIU those symbols are actually empty in that
case, and the above is the only place where they get any content. So
I'd say just W32_OBJ="w32battery.o" etc.
> -#ifdef HAVE_NTGUI
> +#if defined HAVE_NTGUI
> syms_of_w32term ();
> syms_of_w32fns ();
> syms_of_w32menu ();
> syms_of_fontset ();
> #endif /* HAVE_NTGUI */
Why was this change necessary?
Thanks.
next prev parent reply other threads:[~2018-01-13 8:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-13 2:33 Adding battery support on Cygwin Ken Brown
2018-01-13 8:11 ` Eli Zaretskii [this message]
2018-01-13 18:19 ` Ken Brown
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=83tvvq18lx.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=kbrown@cornell.edu \
/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.