From: Christopher Dykes Date: Thu, 31 Mar 2016 17:09:38 +0000 (-0700) Subject: Update the sys/syscall.h portability header for Windows X-Git-Tag: 2016.07.26~396 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c330a7dd2432bc55b719c34be9ec7d2baa2b9c51;p=folly.git Update the sys/syscall.h portability header for Windows Summary: This adds Windows support to the portability header for sys/syscall.h, which was previously named portability/Syscall.h, which is inconsistent with the naming of the other headers, so it's now also been renamed to SysSyscall.h, and the one place that used it updated to reflect the new name. Reviewed By: yfeldblum Differential Revision: D2984383 fb-gh-sync-id: c0e4ce55c7bc2aa6db9b084e09d9762ba587002d fbshipit-source-id: c0e4ce55c7bc2aa6db9b084e09d9762ba587002d --- diff --git a/folly/Makefile.am b/folly/Makefile.am index e421304b..4f3f4d60 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -276,10 +276,10 @@ nobase_follyinclude_HEADERS = \ portability/Memory.h \ portability/String.h \ portability/Strings.h \ - portability/Syscall.h \ portability/SysFile.h \ portability/SysMman.h \ portability/SysStat.h \ + portability/SysSyscall.h \ portability/SysTime.h \ portability/SysTypes.h \ portability/SysUio.h \ diff --git a/folly/experimental/fibers/Fiber.cpp b/folly/experimental/fibers/Fiber.cpp index 83e15cc2..de0e30b8 100644 --- a/folly/experimental/fibers/Fiber.cpp +++ b/folly/experimental/fibers/Fiber.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include namespace folly { namespace fibers { diff --git a/folly/portability/SysSyscall.h b/folly/portability/SysSyscall.h new file mode 100644 index 00000000..5d09042c --- /dev/null +++ b/folly/portability/SysSyscall.h @@ -0,0 +1,29 @@ +/* + * Copyright 2016 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. + */ + +#pragma once + +#ifndef _WIN32 +#include + +#if defined(__APPLE__) +#define FOLLY_SYS_gettid SYS_thread_selfid +#elif defined(SYS_gettid) +#define FOLLY_SYS_gettid SYS_gettid +#else +#define FOLLY_SYS_gettid __NR_gettid +#endif +#endif diff --git a/folly/portability/Syscall.h b/folly/portability/Syscall.h deleted file mode 100644 index 05fae6e1..00000000 --- a/folly/portability/Syscall.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2016 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. - */ - -#ifndef FOLLY_SYSCALL_H_ -#define FOLLY_SYSCALL_H_ - -#include - -#if defined(__APPLE__) -#define FOLLY_SYS_gettid SYS_thread_selfid -#elif defined(SYS_gettid) -#define FOLLY_SYS_gettid SYS_gettid -#else -#define FOLLY_SYS_gettid __NR_gettid -#endif - -#endif