diff --git a/src/main/include/log4cxx/helpers/optional.h b/src/main/include/log4cxx/helpers/optional.h index 0707ec67a..b4a7be728 100644 --- a/src/main/include/log4cxx/helpers/optional.h +++ b/src/main/include/log4cxx/helpers/optional.h @@ -1,10 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You 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 LOG4CXX_OPTIONAL_HDR_ +#define LOG4CXX_OPTIONAL_HDR_ + #ifdef __has_include // Check if __has_include is present # if __has_include() // Check for a standard version # include # if defined(__cpp_lib_optional) // C++ >= 17 namespace LOG4CXX_NS { template< class T > using Optional = std::optional; } #define LOG4CXX_HAS_STD_OPTIONAL 1 -#endif +# endif # elif __has_include() // Check for an experimental version # include namespace LOG4CXX_NS { template< class T > using Optional = std::experimental::optional; } @@ -38,3 +58,5 @@ class Optional : private std::pair }; } // namespace LOG4CXX_NS #endif + +#endif // LOG4CXX_OPTIONAL_HDR_