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

Side by Side Diff: src/common/android/include/sys/user.h

Issue 2152153003: [Android] Guard some NDK workarounds by major version. (Closed) Base URL: https://chromium.googlesource.com/breakpad/breakpad.git@master
Patch Set: remove errant space Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, Google Inc. 1 // Copyright (c) 2012, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 29
30 #ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H 30 #ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H
31 #define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H 31 #define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H
32 32
33 // The purpose of this file is to glue the mismatching headers (Android NDK vs 33 // The purpose of this file is to glue the mismatching headers (Android NDK vs
34 // glibc) and therefore avoid doing otherwise awkward #ifdefs in the code. 34 // glibc) and therefore avoid doing otherwise awkward #ifdefs in the code.
35 // The following quirks are currently handled by this file: 35 // The following quirks are currently handled by this file:
36 // - i386: Use the Android NDK but alias user_fxsr_struct > user_fpxregs_struct. 36 // - i386: Use the Android NDK but alias user_fxsr_struct > user_fpxregs_struct.
37 // - aarch64: Add missing user_regs_struct and user_fpsimd_struct structs. 37 // - aarch64:
38 // - NDK r10: Add missing user_regs_struct and user_fpsimd_struct structs.
39 // - NDK r11+: Add missing <stdint.h> include
38 // - Other platforms: Just use the Android NDK unchanged. 40 // - Other platforms: Just use the Android NDK unchanged.
39 41
40 // TODO(primiano): remove these changes after Chromium has stably rolled to 42 // TODO(primiano): remove these changes after Chromium has stably rolled to
41 // an NDK with the appropriate fixes. 43 // an NDK with the appropriate fixes.
42 44
45 #if defined(ANDROID_NDK_MAJOR_VERSION) && ANDROID_NDK_MAJOR_VERSION > 10
46 #ifdef __aarch64__
47 #include <stdint.h>
48 #endif // __aarch64__
49 #endif // defined(ANDROID_NDK_MAJOR_VERSION) && ANDROID_NDK_MAJOR_VERSION > 10
50
43 #include_next <sys/user.h> 51 #include_next <sys/user.h>
44 52
45 #ifdef __i386__ 53 #ifdef __i386__
46 #ifdef __cplusplus 54 #ifdef __cplusplus
47 extern "C" { 55 extern "C" {
48 #endif // __cplusplus 56 #endif // __cplusplus
49 typedef struct user_fxsr_struct user_fpxregs_struct; 57 typedef struct user_fxsr_struct user_fpxregs_struct;
50 #ifdef __cplusplus 58 #ifdef __cplusplus
51 } // extern "C" 59 } // extern "C"
52 #endif // __cplusplus 60 #endif // __cplusplus
53 #endif // __i386__ 61 #endif // __i386__
54 62
63 #if !defined(ANDROID_NDK_MAJOR_VERSION) || ANDROID_NDK_MAJOR_VERSION == 10
55 #ifdef __aarch64__ 64 #ifdef __aarch64__
56 #ifdef __cplusplus 65 #ifdef __cplusplus
57 extern "C" { 66 extern "C" {
58 #endif // __cplusplus 67 #endif // __cplusplus
59 struct user_regs_struct { 68 struct user_regs_struct {
60 __u64 regs[31]; 69 __u64 regs[31];
61 __u64 sp; 70 __u64 sp;
62 __u64 pc; 71 __u64 pc;
63 __u64 pstate; 72 __u64 pstate;
64 }; 73 };
65 struct user_fpsimd_struct { 74 struct user_fpsimd_struct {
66 __uint128_t vregs[32]; 75 __uint128_t vregs[32];
67 __u32 fpsr; 76 __u32 fpsr;
68 __u32 fpcr; 77 __u32 fpcr;
69 }; 78 };
70 #ifdef __cplusplus 79 #ifdef __cplusplus
71 } // extern "C" 80 } // extern "C"
72 #endif // __cplusplus 81 #endif // __cplusplus
73 #endif // __aarch64__ 82 #endif // __aarch64__
83 #endif // defined(ANDROID_NDK_VERSION) && ANDROID_NDK_MAJOR_VERSION == 10
74 84
75 #endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H 85 #endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698