Mercurial > hg
view contrib/fuzz/fuzzutil.h @ 44638:af739894a4c1
hgcli: add stub PyOxidizer project
Using commit c772a1379c3026314eda1c8ea244b86c0658951d of
PyOxidizer, I ran `pyoxidizer init-rust-project hgcli` to
create a stub Rust project. The only modifications I made from
what that command produced are:
* Update location of pyembed crate to PyOxidizer's Git repository.
* Removed some trailing whitespace from pyoxidizer.bzl
* Added auto-generated Cargo.lock file
Subsequent commits will modify the stub project to Mercurial's
needs.
Differential Revision: https://phab.mercurial-scm.org/D8350
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 31 Mar 2020 19:07:36 -0700 |
parents | 6f5c352f41b6 |
children |
line wrap: on
line source
#ifndef CONTRIB_FUZZ_FUZZUTIL_H #define CONTRIB_FUZZ_FUZZUTIL_H #include <iostream> #include <memory> #include <stdint.h> /* Try and use std::optional, but failing that assume we'll have a * workable https://abseil.io/ install on the include path to get * their backport of std::optional. */ #ifdef __has_include #if __has_include(<optional>) && __cplusplus >= 201703L #include <optional> #define CONTRIB_FUZZ_HAVE_STD_OPTIONAL #endif #endif #ifdef CONTRIB_FUZZ_HAVE_STD_OPTIONAL namespace contrib { using std::nullopt; using std::optional; } /* namespace contrib */ #else #include "third_party/absl/types/optional.h" namespace contrib { using absl::nullopt; using absl::optional; } /* namespace contrib */ #endif /* set DEBUG to 1 for a few debugging prints, or 2 for a lot */ #define DEBUG 0 #define LOG(level) \ if (level <= DEBUG) \ std::cout #endif /* CONTRIB_FUZZ_FUZZUTIL_H */