win: Add compat header for sys/types.h

To add definition of ssize_t. Uses #include <../include/...> to
emulate #include_next, similar to the mac headers.

BUG=crashpad:1
R=mark@chromium.org

Review URL: https://codereview.chromium.org/793013002
This commit is contained in:
Scott Graham 2014-12-10 11:39:50 -08:00
parent c874958fd0
commit 012ddc9752
2 changed files with 38 additions and 1 deletions

View File

@ -29,6 +29,7 @@
'non_win/timezoneapi.h',
'non_win/verrsrc.h',
'non_win/winnt.h',
'win/sys/types.h',
],
'conditions': [
['OS=="mac"', {
@ -44,7 +45,16 @@
],
},
}],
['OS!="win"', {
['OS=="win"', {
'include_dirs': [
'win',
],
'direct_dependent_settings': {
'include_dirs': [
'win',
],
},
}, {
'include_dirs': [
'non_win',
],

27
compat/win/sys/types.h Normal file
View File

@ -0,0 +1,27 @@
// Copyright 2014 The Crashpad Authors. All rights reserved.
//
// 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 CRASHPAD_COMPAT_WIN_SYS_TYPES_H_
#define CRASHPAD_COMPAT_WIN_SYS_TYPES_H_
// This is intended to be roughly equivalent to #include_next.
#include <../include/sys/types.h>
#ifdef _WIN64
typedef __int64 ssize_t;
#else
typedef _W64 int ssize_t;
#endif
#endif // CRASHPAD_COMPAT_WIN_SYS_TYPES_H_