Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1179)

Unified Diff: compat/mac/mach-o/getsect.h

Issue 561933004: 10.6 SDK compatibility (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compat/compat.gyp ('k') | compat/mac/mach-o/getsect.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compat/mac/mach-o/getsect.h
diff --git a/compat/mac/mach-o/getsect.h b/compat/mac/mach-o/getsect.h
new file mode 100644
index 0000000000000000000000000000000000000000..f982c4b4ba9027f277ceef4a7bae285532378621
--- /dev/null
+++ b/compat/mac/mach-o/getsect.h
@@ -0,0 +1,69 @@
+// 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_MAC_MACH_O_GETSECT_H_
+#define CRASHPAD_COMPAT_MAC_MACH_O_GETSECT_H_
+
+#include_next <mach-o/getsect.h>
+
+#include <AvailabilityMacros.h>
+
+// This file checks the SDK instead of the deployment target. The SDK is correct
+// because this file is concerned with providing compile-time declarations,
+// which are either present in a specific SDK version or not.
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+
+#include <mach-o/loader.h>
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Don’t use a typedef to account for the mach_header/mach_header_64 difference
+// between the 32-bit and 64-bit versions of getsectiondata() and
+// getsegmentdata(). This file should be faithfully equivalent to the native
+// SDK, and adding typedefs here would pollute the namespace in a way that the
+// native SDK does not.
+
+#if !defined(__LP64__)
+
+uint8_t* getsectiondata(const struct mach_header* mhp,
+ const char* segname,
+ const char* sectname,
+ unsigned long* size);
+
+uint8_t* getsegmentdata(
+ const struct mach_header* mhp, const char* segname, unsigned long* size);
+
+#else
+
+uint8_t* getsectiondata(const struct mach_header_64* mhp,
+ const char* segname,
+ const char* sectname,
+ unsigned long* size);
+
+uint8_t* getsegmentdata(
+ const struct mach_header_64* mhp, const char* segname, unsigned long* size);
+
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+
+#endif // CRASHPAD_COMPAT_MAC_MACH_O_GETSECT_H_
« no previous file with comments | « compat/compat.gyp ('k') | compat/mac/mach-o/getsect.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698