Hi,

2019/11/28 Thu 6:51:22 UTC+9 Christian Brabandt wrote:
>
>
> On Mi, 27 Nov 2019, Bram Moolenaar wrote: 
>
> > What was the error on FreeBSD?  I thought it also suppored Posix. 
>
> https://cirrus-ci.com/task/5566942320001024 
>
> In file included from os_unix.c:87: 
> /usr/include/sys/consio.h:262:2: error: unknown type name 'u_short'; did 
> you mean 'short'? 
>         u_short         font_size; 
>         ^ 
> /usr/include/sys/consio.h:263:2: error: unknown type name 'u_short'; did 
> you mean 'short'? 
>         u_short         mv_row, mv_col; 
>         ^ 
> /usr/include/sys/consio.h:264:2: error: unknown type name 'u_short'; did 
> you mean 'short'? 
>         u_short         mv_rsz, mv_csz; 
>         ^ 
> /usr/include/sys/consio.h:265:2: error: unknown type name 'u_short'; did 
> you mean 'short'? 
>         u_short         mv_hsz; 
>         ^ 
> /usr/include/sys/consio.h:269:2: error: unknown type name 'u_char'; did 
> you mean 'char'? 
>         u_char          mv_ovscan; 
>         ^ 
> /usr/include/sys/consio.h:270:2: error: unknown type name 'u_char'; did 
> you mean 'char'? 
>         u_char          mk_keylock; 
>         ^ 
> /usr/include/sys/consio.h:319:2: error: unknown type name 'u_char'; did 
> you mean 'char'? 
>         u_char          ti_name[TI_NAME_LEN]; 
>         ^ 
> /usr/include/sys/consio.h:320:2: error: unknown type name 'u_char'; did 
> you mean 'char'? 
>         u_char          ti_desc[TI_DESC_LEN]; 
>         ^ 
> In file included from os_unix.c:88: 
> /usr/include/sys/fbio.h:196:2: error: unknown type name 'u_char'; did you 
> mean 'char'? 
>         u_char  *red;           /* red color map elements */ 
>         ^ 
> /usr/include/sys/fbio.h:197:2: error: unknown type name 'u_char'; did you 
> mean 'char'? 
>         u_char  *green;         /* green color map elements */ 
>         ^ 
> /usr/include/sys/fbio.h:198:2: error: unknown type name 'u_char'; did you 
> mean 'char'? 
>         u_char  *blue;          /* blue color map elements */ 
>         ^ 
> /usr/include/sys/fbio.h:282:2: error: unknown type name 'u_short'; did you 
> mean 'short'? 
>         u_short         accessible_width; /* accessible bytes in scanline 
> */ 
>         ^ 
> /usr/include/sys/fbio.h:283:2: error: unknown type name 'u_short'; did you 
> mean 'short'? 
>         u_short         accessible_height; /* number of accessible 
> scanlines */ 
>         ^ 
> /usr/include/sys/fbio.h:284:2: error: unknown type name 'u_short'; did you 
> mean 'short'? 
>         u_short         line_bytes;     /* number of bytes/scanline */ 
>         ^ 
> /usr/include/sys/fbio.h:285:2: error: unknown type name 'u_short'; did you 
> mean 'short'? 
>         u_short         hdb_capable;    /* can this thing hardware db? */ 
>         ^ 
> /usr/include/sys/fbio.h:286:2: error: unknown type name 'u_short'; did you 
> mean 'short'? 
>         u_short         vmsize;         /* video memory size */ 
>         ^ 
> /usr/include/sys/fbio.h:287:2: error: unknown type name 'u_char'; did you 
> mean 'char'? 
>         u_char          boardrev;       /* board revision # */ 
>         ^ 
> /usr/include/sys/fbio.h:288:2: error: unknown type name 'u_char'; did you 
> mean 'char'? 
>         u_char          pad0; 
>         ^ 
> /usr/include/sys/fbio.h:289:2: error: unknown type name 'u_long'; did you 
> mean 'long'? 
>         u_long          pad1; 
>         ^ 
> fatal error: too many errors emitted, stopping now [-ferror-limit=] 
> 20 errors generated. 
> gmake[2]: *** [Makefile:3338: objects/os_unix.o] Error 1 
> gmake[2]: Leaving directory '/tmp/cirrus-ci-build/src' 
> gmake[1]: *** [Makefile:2030: reconfig] Error 2 
> gmake[1]: Leaving directory '/tmp/cirrus-ci-build/src' 
> gmake: *** [Makefile:29: first] Error 2 
> Exit status: 2 
> > 
> > I think being specific is OK, thus checking for __FreeBSD__ would be OK. 
> > Otherwise we would need a configure check of some kind. 
> > 
>

If we use __FreeBSD__, maybe we also need to add checks for other BSDs.
It seems that "BSD" is defined in sys/param.h, so how about this patch?

--- a/src/vim.h
+++ b/src/vim.h
@@ -36,7 +36,10 @@
     Error: configure did not run properly.  Check auto/config.log.
 # endif
 
-# if defined(UNIX) && !defined(MACOS_X)
+# ifdef HAVE_SYS_PARAM_H
+#  include <sys/param.h>
+# endif
+# if defined(UNIX) && !defined(MACOS_X) && !defined(BSD)
 // Needed for strptime().  Needs to be done early, since header files can
 // include other header files and end up including time.h, where these 
symbols
 // matter for Vim.

Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/5a6a1c75-720d-459d-b5a4-4564d9f065b4%40googlegroups.com.

Raspunde prin e-mail lui