Commit Graph

58 Commits

Author SHA1 Message Date
kylo252
39d149752f
fix(build): missing definitions for sizeof macros #16393
Verified with -Wundef

Fixes #16392
2022-04-26 19:41:11 -07:00
Claes Nästén
2c8f4d0912 fix: add forkpty for SunOS variants
forkpty is missing on Solaris < 11 and Illumos, provide fallback implementation
for non Solaris 11 users.
2021-12-12 11:29:56 +00:00
Claes Nästén
8f1fdbc54a fix: add STRNLEN compatability macro
Older SunOS systems come without strnlen, add STRNLEN macro in line with
the other str* compat macros.
2021-12-06 17:34:26 +01:00
dundargoc
caa6992a10
chore: fix typos (#16361)
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
Co-authored-by: Brede Yabo Sherling Kristensen <bredeyabo@hotmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: István Donkó <istvan.donko@gmail.com>
Co-authored-by: Julian Berman <Julian@GrayVines.com>
Co-authored-by: bryant <bryant@users.noreply.github.com>
Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
Co-authored-by: nlueb <9465658+nlueb@users.noreply.github.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Jesse Wertheim <jaawerth@gmail.com>
Co-authored-by: dm1try <me@dmitry.it>
Co-authored-by: Jakub Łuczyński <doubleloop@o2.pl>
Co-authored-by: Louis Lebrault <louis.lebrault@gmail.com>
2021-11-27 11:10:48 -05:00
erw7
16d06fa3eb
fix(eval): fix has('wsl') #16153
Problem:
has('wsl') is decided at build-time.

Solution:
Check os_uname().
Fixes #12642, #16143
2021-10-29 16:55:32 -07:00
Jan Edmund Lazo
3261ba98a2
vim-patch:8.1.2326: cannot parse a date/time string
Problem:    Cannot parse a date/time string.
Solution:   Add strptime(). (Stephen Wall, closes #)
10455d43fe

N/A patches for version.c:

vim-patch:8.1.2344: Cygwin: warning for using strptime()

Problem:    Cygwin: warning for using strptime().
Solution:   Move defining _XOPEN_SOURCE and __USE_XOPEN to vim.h. (Ken Takata,
            closes vim/vim#5265)  Use 700 for _XOPEN_SOURCE for mkdtemp().
6a228c6463
2021-03-27 10:53:41 -04:00
Zachary P. Landau
d4fc7b25e8 basic support for usdt probes 2020-10-10 09:52:12 +02:00
Luis Hagenauer
b807de36d4
build: match WSL2 kernel name (#12425) 2020-06-04 14:07:09 +02:00
Daniel Hahler
30ae60e7ca
Fix/revisit git-describe enhancement (#11124)
* Fix/keep massaging git-describe result

Ref: https://github.com/neovim/neovim/pull/11117#issuecomment-536416223

* build: revisit generation of version from Git

Fixes "make clean && make", where "auto/versiondef.h" would be missing
since b18b84d - because BYPRODUCTS are apparently removed when cleaning.

This includes the following improvements/changes:

- do not run git-describe during CMake's configure phase just for
  reporting
- do not print with changed Git version (too noisy, simplifies code)

* Move to src/nvim (included before config) for easier flow

* fallback to describe always, write empty include file

* update_version_stamp.lua: use prefix always
2019-10-02 03:45:59 +02:00
Daniel Hahler
b18b84df5e
build: run git-describe for dev version during build (#11117)
This avoids invoking CMake after a new commit, which might take 15s on
some systems.

Skipped on CMake < 3.2.0 (missing BYPRODUCTS support).

Co-Authored-By: Justin M. Keyes <justinkz@gmail.com>
2019-09-30 00:10:29 +02:00
erw7
d6f15ccc3c remove DYNAMIC_ICONV 2019-08-06 12:44:22 +09:00
Justin M. Keyes
3b504e7c8d
fileio.c: eliminate set_file_time() #10357
Introduce os_file_settime(), remove cruft.
2019-06-30 16:00:35 +02:00
Justin M. Keyes
6cd4ff2ab7
os: remove uv_translate_sys_error impl #9652
Since libuv minimum version is now v1.12, we can use libuv's impl.
2019-03-01 02:34:32 +01:00
Justin M. Keyes
89515304e4 os/env: use libuv v1.12 getenv/setenv API
- Minimum required libuv is now v1.12
- Because `uv_os_getenv` requires allocating, we must manage a map
  (`envmap` in `env.c`) to maintain the old behavior of `os_getenv` .
- free() map-items after removal. khash.h does not make copies of
  anything, so even its keys must be memory-managed by the caller.

closes #8398
closes #9267
2019-02-27 23:29:07 +01:00
James McCoy
c2343180d7
Remove support for using jemalloc instead of the system allocator
There was never any investigation done to determine whether using
jemalloc was actually a net benefit for nvim.  It has been a portability
limitation and adds another factor to consider when triaging issues.
2019-01-19 18:09:52 -05:00
Mahmoud Al-Qudsi
5d2dd2ebe2 win: has("wsl") on Windows Subsystem for Linux #7330
Per CMAKE docs, CMAKE_HOST_SYSTEM_VERSION is the result of `uname -r`:
https://cmake.org/cmake/help/v3.4/variable/CMAKE_HOST_SYSTEM_VERSION.html?highlight=uname

    A numeric version string for the system. On systems that support
    uname, this variable is set to the output of uname -r. On other
    systems this is set to major-minor version numbers.

On Windows it is something like "6.1", so it won't match ".*-Microsoft".

Closes #7329
2018-01-30 21:12:49 +01:00
Justin M. Keyes
432e9e5a2e build: Do not check for obsolete <termio.h> 2016-12-24 17:41:06 +01:00
Justin M. Keyes
af2e629be4 tui: check stty/termios for kbs
Requires libtermkey 0.19+

Closes #2048
Closes #5693

See a9b61424aa%5E...c0eb4e4a05f49ad8fee0195c77f2c29d09cc36af
See https://bugzilla.redhat.com/show_bug.cgi?id=142659
See fe4e9470bb/tty-keys.c (L625-L632)
2016-12-23 18:28:54 +01:00
James McCoy
9b0b281b75
config: Allow setting USERNAME/HOSTNAME from the environment
Allowing this to be controlled externally improves reproducibility, as
well as provides a more useful address to report for "Compiled by".  For
example, I intend to set it to the packaging list when building the
Debian package.

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-10-08 14:22:36 -04:00
ZyX
516b7071ca file: Add buffered reading and writing
Still no busted tests. Not tested without HAVE_PREADV.
2016-06-23 21:17:51 +03:00
ZyX
11dda658d6 file,os/fs,shada: Separate opening, closing, writing and reading files
Moves low-level functions handling to os/fs.c. Adds file.c with a proxy
interface.

Target: while leaving syscalls handling is os.c (partially handled by libuv),
add buffering for reading and writing to file.c.
2016-06-23 21:17:51 +03:00
John Szakmeister
d3a904309b Fix be64toh() detection on BSDs.
This was noticed due to a user issue (#4750) when building Neovim 0.1.4
via ports.  The crux of the issue is that we did not detect the
be64toh() macro, because there is no endian.h on FreeBSD (along with
several other BSDs).  So we were defaulting to our builtin version of
be64toh().  However, it appears that sys/endian.h was being picked up by
an include (likely msgpack.h) and so be64toh() was actually defined and
corrupting our definition of it.

So the answer here was to use the correct include file in our check, and
export that information in the config.h.  Then we use that information
to include the right header in shada.c.

This fixes #4750.
2016-05-14 12:47:20 -04:00
Seth Jackson
33321f2c85 config: Remove HAVE_UNISTD_H.
Unix systems must have this header but Windows does not have it at all.

Since src/nvim/os/unix_defs.h includes <unistd.h> without the guard
in order to avoid including this in the numerous places we would
need <unistd.h> on Unix we just include src/nvim/os/os.h which will pull
in <unistd.h> for us.
2016-01-18 13:48:47 -05:00
Seth Jackson
51d95d1438 config: Remove duplicate check for HAVE_UTIME_H. 2016-01-18 09:22:25 -05:00
Seth Jackson
5dfbe6685d config: Remove HAVE_FCNTL_H.
We do not use it and all systems we support have <fcntl.h>.
2016-01-17 09:40:07 -05:00
Seth Jackson
a7ade5c832 misc: UNIX => Unix #4022
Although UNIX is a registered trademark of The Open Group, it doesn't
really matter whether we refer to these systems as UNIX, Unix, or
Unix-like. So, for consistency, refer to them collectively as Unix.

Related:
http://www.greens.org/about/unix.html
http://www.unixica.com/html/unixunix.html
2016-01-16 18:34:31 -05:00
Seth Jackson
7c79ea70ef config: Cleanup unused identifiers.
HAVE_CRT_EXTERNS_H is unused since a3ec68c.
SIZEOF_OFF_T is unused since f916cf0.
HAVE_LIBGEN_H was never used.
2016-01-12 20:31:18 -05:00
Michael Reed
5db511b6f1 Stop using <stropts.h>
In Vim, at least the constant `I_PUSH` is used from <stropts.h>, but
Neovim doesn't seem to use anything from said header.

Besides that, POSIX.1-2008[1] marks this header as obsolescent, and
there don't seem to be many platforms that even have it.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stropts.h.html#tag_13_52_11
2016-01-12 16:40:22 -05:00
Michael Reed
f65d58907d os/*_defs.h: MAXNAMLEN cleanup
For non-Windows systems, we assume that NAME_MAX is in <limits.h>, as
specified in POSIX.1-2008[1]. For Windows, which doesn't have NAME_MAX,
just define it ourselves to _MAX_PATH[2].

Also, remove two (now unused) HAVE_*_H checks.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
[2]: https://msdn.microsoft.com/en-us/library/930f87yf.aspx

Helped-by: Seth Jackson
2016-01-12 12:26:15 -05:00
Seth Jackson
648aebb8b6 Port fsync() to libuv. 2016-01-01 00:12:28 -05:00
Rui Abreu Ferreira
810d31a430 Windows: Implement os_setenv() using _putenv_s()
Windows does not have setenv(), instead the _putenv_s() function is used - added
a function check and fatal errors. Implemented os_setenv() for Windows.

Vim supports the original putenv() function if no alternative is available.
Neovim only supports systems where safer alternatives exist, so the check for
putenv() was removed from config/CMakeLists.txt.
2015-12-12 22:33:10 -05:00
ZyX
d1830e1433 config: Check order and endianess even when cross-compiling 2015-10-08 22:00:45 +03:00
ZyX
0d15b35d49 shada,config: Use CMake to determine endianess and be64toh existence 2015-10-08 22:00:44 +03:00
Michael Reed
a4856694e1 Small cleanup after #3227
HAVE_SYS_TIME_H isn't being used by anything, remove it.
2015-08-25 21:38:15 -04:00
Rui Abreu Ferreira
99aacb1429 cmake: Remove unneeded platform checks
Removed unneeded platform checks from config/config.h.in and
config/CMakeLists.txt

- HAVE_OSPEED and HAVE_UP_BC_PC were used by the old UI, and are
  no longer needed.
- sigvec() was used as part of the signal handling code in os_unix.c, but it is
  no longer used in Neovim.
- The function lstat() is no longer used, replaced with libuv.
2015-05-21 23:16:40 +01:00
Rui Abreu Ferreira
82c36970b8 Dont require setenv() in non Unix systems
config/CMakeLists.txt failed with a fatal error if the functions
setenv  could not be found, however this functions only exist in Unix
systems.
2015-05-21 23:16:39 +01:00
Florian Walch
8130eb1191 jemalloc: Force use of prefixed functions.
* Set JEMALLOC_NO_DEMANGLE to be able to use `je_*` functions,
  regardless of how jemalloc was compiled (--with-jemalloc-prefix)
* Show jemalloc information in Neovim's version output.

Resolve #2449.
2015-04-29 22:26:55 +03:00
Rui Abreu Ferreira
71487a935e Implement os_unsetenv()
- In UNIX systems where unsetenv() is available, it is used. Otherwise
  the variables are set with the empty string.
- New check HAVE_UNSETENV for unsetenv()
- Added unit test to env_spec.lua
2015-04-14 15:20:50 -04:00
Björn Linse
4f92178a75 config: split out versiondef.h from config.h
This avoids recompiling every c file after comitting.
2015-03-08 21:54:57 -04:00
Thiago de Arruda
e0e41b30c6 ui: Remove/adapt some old code for a big UI refactor
- Remove abstract_ui global, now it is always active
- Remove some terminal handling code
- Remove unused functions
- Remove HAVE_TGETENT/TERMINFO/TERMIOS/IOCTL #ifdefs
- Remove tgetent/terminfo from version.c
- Remove curses/terminfo dependencies
- Only start/stop termcap when starting/exiting the program
- msg_use_printf will return true if there are no attached UIs(
  messages will be written to stdout)
- Remove `ex_winpos`(implement `:winpos` with `ex_ni`)
2015-02-16 23:17:39 -03:00
Eliseo Martínez
4d0ef9a6b9 coverity/13745: Argument cannot be negative: RI.
Problem    : Argument cannot be negative @ 1165.
Diagnostic : Real issue.
Rationale  : len can be assigned a negative value @ 1162;
             len is passed as an unsigned argument @ 1165.
Resolution : Refactor variable's types:
             - Use ftello instead of ftell to avoid using long.
             - Assert ftello result is safely convertible to size_t.
             - Introduce variable read_size to avoid using i (int).
2015-02-02 01:21:58 -05:00
Eliseo Martínez
634d5d86a7 coverity/100248: Operands don't affect result: HI.
Problem    : Operands don't affect results (CONSTANT_EXPRESSION_RESULT).
Diagnostic : Harmless issue.
Rationale  : n >= LONG_MIN, n being intmax_t, is always true for
             architectures where sizeof(intmax_t) == sizeof(long).
Resolution : Add sizes check.
2015-01-16 09:26:01 +01:00
Eliseo Martínez
516405b601 Remove long_u: Passing-by: put_time(): Refactor implementation.
put_time() had a complicated implementation, because of having to shift
an 8-byte value in a portable way with old means.
That can be greatly simplified now, using a C99 fixed-size type.
2014-12-24 20:00:05 +01:00
John Szakmeister
9344a40e74 build: pull iconv detection into its own FindIconv.cmake file
This will provide better control for those who may want to alter which
one gets used.
2014-11-08 16:22:35 -05:00
Nicolas Hillegeer
8c5efd62ac iconv: re-enable
This seems to have been disabled in the transition from vim to neovim,
re-enable it.
2014-11-06 00:18:26 +01:00
Pavel Platto
94f3d30306 os_fchown: impl and remove HAVE_FCHOWN 2014-08-13 09:13:58 +03:00
Nicolas Hillegeer
7b1d46f39d cmake: remove check for gettimeofday
There are no more uses of gettimeofday, so remove the check in CMake.
2014-07-21 19:30:00 +02:00
Rui Abreu Ferreira
feffc65270 Add cmake platform checks
- Defined CMake checks for all headers in config.h.in
- Removed headers checks that are not used anymore:
  sgtty.h sys/statfs.h libintl.h poll.h
- Added UNIX check
- Add some fatal checks
  + Check for setenv() and fail if it does not exist
    since our os layer just assumes it does
  + lstat is required by os_unix.c
  + sys/wait.h is required in UNIX
- Removed entries for functions that are not being used: getcwd,
  getrlimit, getwd, nanosleep, sigaltstack, getwd, sigstack, fseeko
- Replaced nearly all defines in config.h.in for functions with
  compile time checks
- Add check for symbol FD_CLOEXEC
- Add check for langinfo CODESET
- HAVE_ICONV_H and HAVE_ICONV hold the expected checks but Neovim uses
  USE_ICONV define to actually decide whether to enable it
- Removed checks that are no longer needed
  + USEMEMMOVE
  + _FILE_OFFSET_BITS
  + HAVE_ST_BLKSIZE
  + dlfcn.h
2014-07-15 10:43:21 +02:00
Thiago de Arruda
f0f4ab5500 Use platform check for correct selection of khash type in helpers.c 2014-05-13 14:11:32 -03:00
John Szakmeister
14e4e678b9 Allow USERNAME to be specified on the command line.
There are some systems that have usernames of the form DOMAIN\username,
which causes an invalid escape character to be inserted.  I was going to
add some escaping, but decided it would be best to just outright set the
value, since I don't want the DOMAIN portion in there anyways.
2014-04-21 17:29:40 -04:00