From 4459989b0fe012a32faa073d8526b818f4063a85 Mon Sep 17 00:00:00 2001 From: Hans Fugal Date: Tue, 21 Oct 2014 10:24:14 -0700 Subject: [PATCH] (wangle) Fix a couple compilation issues Summary: If you try to include files in a weird (but not incorrect) order you get compilation errors. No longer! Test Plan: new dummy `cpp_binary` target Reviewed By: davejwatson@fb.com Subscribers: trunkagent, folly-diffs@, net-systems@, fugalh, exa, njormrod FB internal diff: D1621083 --- folly/wangle/Future.h | 6 ++++++ folly/wangle/Promise.h | 2 +- folly/wangle/Try.h | 4 ++++ folly/wangle/test/ClientCompile.cpp | 22 ++++++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 folly/wangle/test/ClientCompile.cpp diff --git a/folly/wangle/Future.h b/folly/wangle/Future.h index 4f0348ce..f3d50ce0 100644 --- a/folly/wangle/Future.h +++ b/folly/wangle/Future.h @@ -29,6 +29,12 @@ namespace folly { namespace wangle { +namespace detail { + template struct Core; + template struct VariadicContext; +} +template struct Promise; + template struct isFuture; template diff --git a/folly/wangle/Promise.h b/folly/wangle/Promise.h index 61bc0699..7442e451 100644 --- a/folly/wangle/Promise.h +++ b/folly/wangle/Promise.h @@ -17,7 +17,6 @@ #pragma once #include -#include namespace folly { namespace wangle { @@ -98,4 +97,5 @@ private: }} +#include #include diff --git a/folly/wangle/Try.h b/folly/wangle/Try.h index d13fffb5..68d3ef92 100644 --- a/folly/wangle/Try.h +++ b/folly/wangle/Try.h @@ -16,6 +16,10 @@ #pragma once +#include +#include +#include + namespace folly { namespace wangle { template diff --git a/folly/wangle/test/ClientCompile.cpp b/folly/wangle/test/ClientCompile.cpp new file mode 100644 index 00000000..45ad8cd4 --- /dev/null +++ b/folly/wangle/test/ClientCompile.cpp @@ -0,0 +1,22 @@ +/* + * Copyright 2014 Facebook, Inc. + * + * 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. + */ + +// amazing what things can go wrong if you include things in an unexpected +// order. +#include +#include +#include +int main() { return 0; } -- 2.34.1