all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Fix build error in terminal.c on FreeBSD
@ 2015-09-13 17:48 Ashish SHUKLA
  2015-09-13 18:59 ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: Ashish SHUKLA @ 2015-09-13 17:48 UTC (permalink / raw)
  To: emacs-devel; +Cc: Paul Eggert


[-- Attachment #1.1: Type: text/plain, Size: 2458 bytes --]

Hi,

On FreeBSD (and pretty sure other non-GNU/Linux platforms) with svgalib port
(which provides stub <linux/kd.h>) installed, I get following error with emacs
HEAD (commit: 6514b30e6):

--8<---------------cut here---------------start------------->8---
  CC       terminal.o
terminal.c:545:32: error: array has incomplete element type 'struct unipair'
  struct unipair unipair_buffer[initial_unipairs];
                               ^
terminal.c:545:10: note: forward declaration of 'struct unipair'
  struct unipair unipair_buffer[initial_unipairs];
         ^
terminal.c:552:25: error: variable has incomplete type 'struct unimapdesc'
      struct unimapdesc unimapdesc = { entry_ct, entries };
                        ^
terminal.c:552:14: note: forward declaration of 'struct unimapdesc'
      struct unimapdesc unimapdesc = { entry_ct, entries };
             ^
terminal.c:553:22: error: use of undeclared identifier 'GIO_UNIMAP'; did you mean 'GDK_UNMAP'?
      if (ioctl (fd, GIO_UNIMAP, &unimapdesc) == 0)
                     ^~~~~~~~~~
                     GDK_UNMAP
/usr/local/include/gtk-3.0/gdk/gdkevents.h:309:3: note: 'GDK_UNMAP' declared here
  GDK_UNMAP             = 15,
  ^
terminal.c:557:39: error: subscript of pointer to incomplete type 'struct unipair'
            char_table_set (glyphtab, entries[i].unicode,
                                      ~~~~~~~^
terminal.c:545:10: note: forward declaration of 'struct unipair'
  struct unipair unipair_buffer[initial_unipairs];
         ^
terminal.c:564:64: error: invalid application of 'sizeof' to an incomplete type 'struct unipair'
      entries = alloced = xrealloc (alloced, entry_ct * sizeof *alloced);
                                                               ^~~~~~~~
terminal.c:545:10: note: forward declaration of 'struct unipair'
  struct unipair unipair_buffer[initial_unipairs];
         ^
5 errors generated.
Makefile:363: recipe for target 'terminal.o' failed
gmake[3]: *** [terminal.o] Error 1
--8<---------------cut here---------------end--------------->8---

This seems to have come from commit 6e5d81ff4 (cc'ed author). A probable fix
is attached.

Also, if you don't mind could you please Cc me on replies, as I've delivery
disabled in list subscription.

Thanks!
-- 
Ashish SHUKLA

“Any priest or shaman must be presumed guilty until proved innocent.” (Robert
A. Heinlein, 1973)

Sent from my Emacs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: terminal.c.diff --]
[-- Type: text/x-patch, Size: 1010 bytes --]

diff --git a/src/terminal.c b/src/terminal.c
index d7c16d9..638c663 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -28,7 +28,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "coding.h"
 #include "keyboard.h"
 
-#ifdef HAVE_LINUX_KD_H
+#if (defined(__linux__) && defined(HAVE_LINUX_KD_H))
 # include <errno.h>
 # include <linux/kd.h>
 # include <sys/ioctl.h>
@@ -532,7 +532,7 @@ selected frame's terminal).  */)
   return store_terminal_param (decode_live_terminal (terminal), parameter, value);
 }
 
-#if HAVE_LINUX_KD_H
+#if (defined(__linux__) && defined(HAVE_LINUX_KD_H))
 
 /* Compute the glyph code table for T.  */
 
@@ -575,7 +575,7 @@ calculate_glyph_code_table (struct terminal *t)
 Lisp_Object
 terminal_glyph_code (struct terminal *t, int ch)
 {
-#if HAVE_LINUX_KD_H
+#if (defined(__linux__) && defined(HAVE_LINUX_KD_H))
   if (t->type == output_termcap)
     {
       /* As a hack, recompute the table when CH is the maximum

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-13 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-13 17:48 [PATCH] Fix build error in terminal.c on FreeBSD Ashish SHUKLA
2015-09-13 18:59 ` Paul Eggert
2015-09-13 20:32   ` Ashish SHUKLA

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.