Commit Graph

119 Commits

Author SHA1 Message Date
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
Justin M. Keyes
8a34d21b0d Merge pull request #3706 from Pyrohh/version_commit
Remove "Commit:" field from `--version` output
2015-12-13 03:00:09 -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
Michael Reed
7be12edd38 Remove "Commit:" field from --version output
If nvim is built from a non-tagged commit, the truncated commit hash is
already appended to the main version string (e.g., "NVIM v0.1.0-83-g959f260 ..."),
making the "Commit:" field redundant.

Regarding the truncated hash length: we don't have nearly enough commits
to worry about collisions, and probably won't ever, so the default
length should be fine.
2015-12-05 16:15:32 -05:00
Justin M. Keyes
d0401b04a4 build: Use git describe for version strings.
When building in a git repo:
  - If HEAD corresponds to an annotated tag, (i.e. git_get_exact_tag()
    returns truthy) the current build is considered a "release" build:
    NVIM_VERSION_MEDIUM is directly assigned the tagged version name,
    and NVIM_VERSION_* defines are ignored.
  - If HEAD is not a tagged release, then NVIM_VERSION_MEDIUM is
    directly assigned the result of `git describe`.

If git (or the repo) is not available:
  - The NVIM_VERSION_* defines are used to define NVIM_VERSION_MEDIUM.

Sample outputs for `nvim --version` and `nvim +version`:

    Building with git @ non-tagged commit e66df14:
      NVIM v0.1.0-1-ge66df14 (compiled Nov  1 2015 19:10:30)
      Commit: e66df148f9401be17adab324a6e41d927aae20b3

    Building with git @ v0.1.1 tag:
      NVIM v0.1.1 (compiled Nov  1 2015 19:03:52)
      [no "Commit:" line]

    Building this commit _not_ in a git repo:
      NVIM 0.1.0-dev (compiled Nov  1 2015 19:16:11)
      [no "Commit:" line]
2015-11-01 21:31:29 -05:00
Michael Reed
0c54dc5528 Remove useless FEAT_BROWSE ifdef
The only thing this affected was the return value of
has('browsefilter').
2015-11-01 14:36:23 -05:00
Florian Walch
a83020922d version: Prepare for releases.
* Hide commit information from --version if we can't find any (e.g. when
  building from tarball).

To define a release in CMake, set NVIM_VERSION_PRERELEASE to "".
This will modify --version output to:

    * Show annotated Git tag instead of commit hash (NVIM_VERSION_COMMIT).
    * Hide commit date (NVIM_VERSION_BUILD).
2015-11-01 15:41:36 +01: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
Justin M. Keyes
481049e0c9 build: remove USEMAN_S 2015-09-23 00:05:32 -04:00
Michael Reed
2d50a95601 os/os_defs.h cleanup: Remaining signal stuff
RETSIGTYPE, SIGRETURN, and SIGDEFARG are always defined the same, so
inline them for simplicity; SIGDUMMYARG, however, is unused, so remove
it.

Even if these things don't work on windows, the signal handler in
if_cscope.c is already wrapped with '#idef UNIX', as is its only call
site.

Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
2015-08-27 16:56:05 -04: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
Justin M. Keyes
7280e8c365 remove references to <sys/time.h>
Since gettimeofday() was replaced by os_time in
fb5a786bdb we do not need sys/time.h.
2015-08-24 00:27:30 -04:00
Thomas Anderson
9995f15a98 CMake: Fix helptags generation when prefix is not /usr. #2741 2015-06-09 01:12:08 -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
Michael Reed
c50c831b85 Cleanup 'ttym[ouse]', FEAT_MOUSE, mouse_(dec|gpm|etc.)
Because of 3baba1e7bc, it's dead code.

Helped-by: Justin M. Keyes <justinkz@gmail.com>
2015-05-18 11:06:54 -04: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
Thiago de Arruda
8a1a9b9558 deps: Add jemalloc as an optional dependency
Jemalloc will be used if the cmake option `USE_JEMALLOC` is enabled(which is the
default). To avoid trouble with clang's ASAN, it is disabled by default if the
`SANITIZE` option is enabled.

Since jemalloc has thread cache for small objects, it fills the gap created by
removing klib memory pools.

The `xstrdup` funciton(memory.c) had to be reimplemented on top of `xmalloc` to
make it work with a custom allocator.
2015-04-13 08:22:59 -03:00
Mark Bainter
675e363316 Refactor default_vim{,runtime}_dir to use char type. #2375
See: #459
Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
Reviewed-by: Eliseo Martínez <eliseomarmol@gmail.com>
2015-04-12 10:52:51 +02:00
Scott Prager
feca9624b8 CMakeLists: enable USE_FNAME_CASE on Mac 2015-03-31 11:20:24 -03:00
Jonas Dourado
293a7dc134 Remove platform dependent HAVE_OPENDIR #2010 2015-03-17 23:52: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
Steven Oliver
f3b06ba6d1 globals.h: Remove unused global variable 2015-01-02 21:10:08 -05: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
5714044617 Merge pull request #1441 from jszakmeister/remove-redundant-define
Remove redundant USE_ICONV define from config.h.in.
2014-11-09 14:51:25 -05:00
Florian Walch
176930fa56 version: Add compilation info. 2014-11-09 18:34:57 +01:00
John Szakmeister
2513c5f648 Remove redundant USE_ICONV define from config.h.in.
This was noticed during a review of #1437.
2014-11-09 08:34:29 -05: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
Justin M. Keyes
ea357eb320 version: remove "Compilation" and "Linking" messages.
Can't reliably get this information from cmake (#1267), so it's
misleading to show these messages at all. We can always revert this
commit if we find a way later.
2014-10-07 10:23:15 +00:00
Justin M. Keyes
a1901941f8 version: generate "build number" from commit timestamp
- cmake: git_timestamp() returns last commit time formatted as
  `YYYYMMddHHmm`.
- Always include commit hash in :version and --version output.

`nvim --version` sample output:
  NVIM 0.0.0-alpha+201410070245 (compiled Oct  7 2014 05:30:45)
  Commit: f747b2b1ff7bfe7eb00cc2be82d7af87c98f1111
2014-10-07 10:23:15 +00:00
Justin M. Keyes
2c2fee4d1f version: report commit hash as "build number" in long version string 2014-10-07 10:03:14 +00:00
Pavel Platto
94f3d30306 os_fchown: impl and remove HAVE_FCHOWN 2014-08-13 09:13:58 +03:00
Rui Abreu Ferreira
e672922ef3 Change vimdir path from vim to neovim 2014-07-31 08: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
99e60f6242 Clean up DEBUG check in config.h.in 2014-07-15 10:43:21 +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
Pavel Platto
f9710fba52 Remove HAVE_MKDTEMP
For now we provide simple `mkdtemp` for Windows, in the future we will
use libuv for that.
2014-07-14 21:14:39 +02:00