diff options
author | Kelvin Zhang <zhangkelvin@google.com> | 2021-07-29 14:50:32 -0400 |
---|---|---|
committer | Kelvin Zhang <zhangkelvin@google.com> | 2021-08-17 17:18:51 -0700 |
commit | 011d854311a08d777daba6cf81fd41d62921827a (patch) | |
tree | b785bdf9ce143363c8154f92ff8f163902eb32a1 /aosp/include | |
parent | ae55a30d74dec9fd3590d2b016420a2d3b28c236 (diff) | |
download | zucchini-011d854311a08d777daba6cf81fd41d62921827a.tar.gz |
Get zucchini to compile on AOSP
Test: mm
Change-Id: Ia030273fcc71d0920f2c62327a08903e5e27a544
Diffstat (limited to 'aosp/include')
-rw-r--r-- | aosp/include/absl/types/optional.h | 28 | ||||
-rw-r--r-- | aosp/include/base/check.h | 22 | ||||
-rw-r--r-- | aosp/include/base/check_op.h | 22 | ||||
-rw-r--r-- | aosp/include/base/containers/cxx20_erase.h | 22 | ||||
-rw-r--r-- | aosp/include/base/notreached.h | 22 | ||||
-rw-r--r-- | aosp/include/build/buildflag.h | 47 | ||||
-rw-r--r-- | aosp/include/buildflags.h | 14 |
7 files changed, 177 insertions, 0 deletions
diff --git a/aosp/include/absl/types/optional.h b/aosp/include/absl/types/optional.h new file mode 100644 index 0000000..3321c72 --- /dev/null +++ b/aosp/include/absl/types/optional.h @@ -0,0 +1,28 @@ +// +// Copyright (C) 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef __ZUCCHINI_AOSP_ABSL_OPTIONAL_H +#define __ZUCCHINI_AOSP_ABSL_OPTIONAL_H + +#include <optional> + +namespace absl { + template <typename T> using optional = std::optional<T>; + inline constexpr auto nullopt = std::nullopt; +} + +#endif + diff --git a/aosp/include/base/check.h b/aosp/include/base/check.h new file mode 100644 index 0000000..3ed2e04 --- /dev/null +++ b/aosp/include/base/check.h @@ -0,0 +1,22 @@ +// +// Copyright (C) 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef __ZUCCHINI_AOSP_BASE_CHECK_H +#define __ZUCCHINI_AOSP_BASE_CHECK_H + +#include <base/logging.h> + +#endif /* __ZUCCHINI_AOSP_BASE_CHECK_H */ diff --git a/aosp/include/base/check_op.h b/aosp/include/base/check_op.h new file mode 100644 index 0000000..d72e4a4 --- /dev/null +++ b/aosp/include/base/check_op.h @@ -0,0 +1,22 @@ +// +// Copyright (C) 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef __ZUCCHINI_AOSP_BASE_CHECK_OP_H +#define __ZUCCHINI_AOSP_BASE_CHECK_OP_H + +#include <base/logging.h> + +#endif /* __ZUCCHINI_AOSP_BASE_CHECK_OP_H */ diff --git a/aosp/include/base/containers/cxx20_erase.h b/aosp/include/base/containers/cxx20_erase.h new file mode 100644 index 0000000..2fac314 --- /dev/null +++ b/aosp/include/base/containers/cxx20_erase.h @@ -0,0 +1,22 @@ +// +// Copyright (C) 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef __ZUCCHINI_AOSP_BASE_CONTAINERS_CXX20_ERASE_H +#define __ZUCCHINI_AOSP_BASE_CONTAINERS_CXX20_ERASE_H + +#include <base/stl_util.h> + +#endif diff --git a/aosp/include/base/notreached.h b/aosp/include/base/notreached.h new file mode 100644 index 0000000..631285c --- /dev/null +++ b/aosp/include/base/notreached.h @@ -0,0 +1,22 @@ +// +// Copyright (C) 2021 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef __ZUCCHINI_AOSP_BASE_NOTREACHED_H +#define __ZUCCHINI_AOSP_BASE_NOTREACHED_H + +#include <base/logging.h> + +#endif /* __ZUCCHINI_AOSP_BASE_NOTREACHED_H */ diff --git a/aosp/include/build/buildflag.h b/aosp/include/build/buildflag.h new file mode 100644 index 0000000..8d7c0e0 --- /dev/null +++ b/aosp/include/build/buildflag.h @@ -0,0 +1,47 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BUILD_BUILDFLAG_H_ +#define BUILD_BUILDFLAG_H_ + +// These macros un-mangle the names of the build flags in a way that looks +// natural, and gives errors if the flag is not defined. Normally in the +// preprocessor it's easy to make mistakes that interpret "you haven't done +// the setup to know what the flag is" as "flag is off". Normally you would +// include the generated header rather than include this file directly. +// +// This is for use with generated headers. See build/buildflag_header.gni. + +// This dance of two macros does a concatenation of two preprocessor args using +// ## doubly indirectly because using ## directly prevents macros in that +// parameter from being expanded. +#define BUILDFLAG_CAT_INDIRECT(a, b) a##b +#define BUILDFLAG_CAT(a, b) BUILDFLAG_CAT_INDIRECT(a, b) + +// Accessor for build flags. +// +// To test for a value, if the build file specifies: +// +// ENABLE_FOO=true +// +// Then you would check at build-time in source code with: +// +// #include "foo_flags.h" // The header the build file specified. +// +// #if BUILDFLAG(ENABLE_FOO) +// ... +// #endif +// +// There will no #define called ENABLE_FOO so if you accidentally test for +// whether that is defined, it will always be negative. You can also use +// the value in expressions: +// +// const char kSpamServerName[] = BUILDFLAG(SPAM_SERVER_NAME); +// +// Because the flag is accessed as a preprocessor macro with (), an error +// will be thrown if the proper header defining the internal flag value has +// not been included. +#define BUILDFLAG(flag) (BUILDFLAG_CAT(BUILDFLAG_INTERNAL_, flag)()) + +#endif // BUILD_BUILDFLAG_H_ diff --git a/aosp/include/buildflags.h b/aosp/include/buildflags.h new file mode 100644 index 0000000..2b63e59 --- /dev/null +++ b/aosp/include/buildflags.h @@ -0,0 +1,14 @@ +// Generated by build/write_buildflag_header.py +// From "//components/zucchini:buildflags" + +#ifndef COMPONENTS_ZUCCHINI_BUILDFLAGS_H_ +#define COMPONENTS_ZUCCHINI_BUILDFLAGS_H_ + +#include "build/buildflag.h" + +#define BUILDFLAG_INTERNAL_ENABLE_DEX() (1) +#define BUILDFLAG_INTERNAL_ENABLE_ELF() (1) +#define BUILDFLAG_INTERNAL_ENABLE_WIN() (0) +#define BUILDFLAG_INTERNAL_ENABLE_ZTF() (0) + +#endif // COMPONENTS_ZUCCHINI_BUILDFLAGS_H_ |