Update the sys/syscall.h portability header for Windows
authorChristopher Dykes <cdykes@fb.com>
Thu, 31 Mar 2016 17:09:38 +0000 (10:09 -0700)
committerFacebook Github Bot 8 <facebook-github-bot-8-bot@fb.com>
Thu, 31 Mar 2016 17:20:35 +0000 (10:20 -0700)
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

folly/Makefile.am
folly/experimental/fibers/Fiber.cpp
folly/portability/SysSyscall.h [new file with mode: 0644]
folly/portability/Syscall.h [deleted file]

index e421304b6aba307c633cf6c2750b73d89e123085..4f3f4d6060c565ed93f20d90bfb4cd50e635c95c 100644 (file)
@@ -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 \
index 83e15cc20048f7e49419fff597fd4e852865cd81..de0e30b8d9dfb42489975724b9bf28d480b0b062 100644 (file)
@@ -27,7 +27,7 @@
 #include <folly/Portability.h>
 #include <folly/experimental/fibers/BoostContextCompatibility.h>
 #include <folly/experimental/fibers/FiberManager.h>
-#include <folly/portability/Syscall.h>
+#include <folly/portability/SysSyscall.h>
 
 namespace folly { namespace fibers {
 
diff --git a/folly/portability/SysSyscall.h b/folly/portability/SysSyscall.h
new file mode 100644 (file)
index 0000000..5d09042
--- /dev/null
@@ -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 <sys/syscall.h>
+
+#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 (file)
index 05fae6e..0000000
+++ /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 <sys/syscall.h>
-
-#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