File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 1
1
#ifndef _pyth_oracle_util_compat_stdint_h_
2
2
#define _pyth_oracle_util_compat_stdint_h_
3
3
4
- /* solana uses its own definitions for stdint types and that can cause
5
- problems with compilation */
4
+ /* Include functionality from <stdint.h>. Define
5
+ PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE to indicate how to do this:
6
+ 0 - Use stdint.h directly
7
+ 1 - Use solana_sdk.h (solana uses its own definitions for stdint
8
+ types and that can conflicts with stdint.h)
9
+ Defaults to 0 or 1 depending on if __bpf__ is set. */
6
10
7
- #ifdef __bpf__
11
+ #ifndef PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE
12
+ #ifndef __bpf__
13
+ #define PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE 0
14
+ #else
15
+ #define PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE 1
16
+ #endif
17
+ #endif
18
+
19
+ #if PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE == 0
20
+ #include <stdint.h>
21
+ #elif PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE == 1
8
22
#include <solana_sdk.h>
9
23
typedef uint64_t uintptr_t ;
10
24
#else
11
- #include <stdint.h>
25
+ #error "Unsupported PYTH_ORACLE_UTIL_COMPAT_STDINT_STYLE"
12
26
#endif
13
27
14
28
#endif /* _pyth_oracle_util_compat_stdint_h_ */
You can’t perform that action at this time.
0 commit comments