folly: fix sysMembarrier() with newer kernel headers
[folly.git] / folly / portability / SysTypes.h
1 /*
2  * Copyright 2017 Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #pragma once
18
19 #include <sys/types.h>
20
21 #ifdef _WIN32
22 #include <basetsd.h> // @manual
23
24 #define HAVE_MODE_T 1
25
26 // This is a massive pain to have be an `int` due to the pthread implementation
27 // we support, but it's far more compatible with the rest of the windows world
28 // as an `int` than it would be as a `void*`
29 using pid_t = int;
30 // This isn't actually supposed to be defined here, but it's the most
31 // appropriate place without defining a portability header for stdint.h
32 // with just this single typedef.
33 using ssize_t = SSIZE_T;
34 // The Windows headers don't define this anywhere, nor do any of the libs
35 // that Folly depends on, so define it here.
36 using mode_t = unsigned short;
37 #endif