Commit Graph

5 Commits

Author SHA1 Message Date
Kostia Balytskyi
e91017d5d0 compatibility: fix core mpatch.h and compat.h
Summary:
This both fixes semantics and makes `compat.h` a bit more readable.
This because necessary, because we migtrated from external `compat.h` to `mercurial/compat.h` in D7064623.

Reviewed By: DurhamG

Differential Revision: D7196403

fbshipit-source-id: 0005cc2f4e58951adfe8f7f795067da728ad64ae
2018-04-13 21:51:24 -07:00
Yuya Nishihara
a22ffac20b encoding: add function to test if a str consists of ASCII characters
Most strings are ASCII. Let's optimize for it.

Using uint64_t is slightly faster than uint32_t on 64bit system, but there
isn't huge difference.
2017-04-23 12:59:42 +09:00
Yuya Nishihara
5c185fa427 compat: define ssize_t as int on 32bit Windows, silences C4142 warning
It appears Python.h provides ssize_t, which is aliased to int.

https://hg.python.org/cpython/file/v2.7.11/PC/pyconfig.h#l205
2016-07-15 23:54:56 +09:00
Maciej Fijalkowski
99f034fe89 compat: provide a declaration of ssize_t, for MS windows 2016-07-11 13:53:35 +02:00
Maciej Fijalkowski
8e7a874bdf internals: move the bitmanipulation routines into its own file
This is to allow more flexibility with the C sources -- now the
bitmanipulation routines can be safely imported without importing Python.h
2016-06-06 13:08:13 +02:00