diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-19 22:19:21 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-19 22:19:21 +0000 |
commit | 2ba1c6cfc414c52b3798e18de01ecf24ae8c5e59 (patch) | |
tree | e272e785ca53e82de6cca1fbb54754ee3b5ba2b8 /third_party | |
parent | ea5b8bb0dd358836695f6e8521be995adbe6e54c (diff) | |
download | chromium_src-2ba1c6cfc414c52b3798e18de01ecf24ae8c5e59.zip chromium_src-2ba1c6cfc414c52b3798e18de01ecf24ae8c5e59.tar.gz chromium_src-2ba1c6cfc414c52b3798e18de01ecf24ae8c5e59.tar.bz2 |
Check in C99 compatibility headers for MSVC and FFmpeg.
MSVC doesn't include <stdint.h> and <inttypes.h>, so in order for MSVC to include FFmpeg headers we need to provide them. The headers aren't complete, but contain the bare minimum for compatibility.
Although we could add these types to base/basictypes.h, I'm afraid of people using C99 types by accident (uint8_t instead of uint8). Also, base/basictypes.h includes C++ code which makes including it from an extern "C" section problematic.
Review URL: http://codereview.chromium.org/21521
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10048 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/ffmpeg/include/win/inttypes.h | 10 | ||||
-rw-r--r-- | third_party/ffmpeg/include/win/stdint.h | 26 | ||||
-rw-r--r-- | third_party/ffmpeg/using_ffmpeg.vsprops | 2 |
3 files changed, 37 insertions, 1 deletions
diff --git a/third_party/ffmpeg/include/win/inttypes.h b/third_party/ffmpeg/include/win/inttypes.h new file mode 100644 index 0000000..8b7de6d --- /dev/null +++ b/third_party/ffmpeg/include/win/inttypes.h @@ -0,0 +1,10 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_FFMPEG_INCLUDE_WIN_INTTYPES_H_ +#define THIRD_PARTY_FFMPEG_INCLUDE_WIN_INTTYPES_H_ + +#include "third_party/ffmpeg/include/win/stdint.h" + +#endif // THIRD_PARTY_FFMPEG_INCLUDE_WIN_INTTYPES_H_ diff --git a/third_party/ffmpeg/include/win/stdint.h b/third_party/ffmpeg/include/win/stdint.h new file mode 100644 index 0000000..280bdb1 --- /dev/null +++ b/third_party/ffmpeg/include/win/stdint.h @@ -0,0 +1,26 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// FFmpeg is written in C99 and requires <stdint.h> and <inttypes.h>. +// Since MSVC doesn't include these headers, we have to write our own version +// to provide a compatibility layer between MSVC and the FFmpeg headers. + +#ifndef THIRD_PARTY_FFMPEG_INCLUDE_WIN_STDINT_H_ +#define THIRD_PARTY_FFMPEG_INCLUDE_WIN_STDINT_H_ + +#if !defined(_MSC_VER) +#error This file should only be included when compiling with MSVC. +#endif + +// Define C99 equivalent types. +typedef signed char int8_t; +typedef signed short int16_t; +typedef signed int int32_t; +typedef signed long long int64_t; +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +typedef unsigned long long uint64_t; + +#endif // THIRD_PARTY_FFMPEG_INCLUDE_WIN_STDINT_H_ diff --git a/third_party/ffmpeg/using_ffmpeg.vsprops b/third_party/ffmpeg/using_ffmpeg.vsprops index ea674e2..e190f9f 100644 --- a/third_party/ffmpeg/using_ffmpeg.vsprops +++ b/third_party/ffmpeg/using_ffmpeg.vsprops @@ -6,7 +6,7 @@ > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories="$(SolutionDir)..\third_party\ffmpeg\include" + AdditionalIncludeDirectories="$(SolutionDir)..\third_party\ffmpeg\include;$(SolutionDir)..\third_party\ffmpeg\include\win" /> <Tool Name="VCLinkerTool" |