diff options
| author | Ron Yorston <rmy@pobox.com> | 2025-08-10 07:46:58 +0100 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2025-08-10 07:46:58 +0100 |
| commit | c70a65f36c017f6feb7e86415bec1a644e71dbab (patch) | |
| tree | e1c3afca24fd35bd2ff142cc0ea83151fdfa5996 /include | |
| parent | dcb4966c5492aeb67494d9ffdc58ff3054add443 (diff) | |
| parent | 84766710f420dd444e2a03d33a1915ce55661e67 (diff) | |
| download | busybox-w32-c70a65f36c017f6feb7e86415bec1a644e71dbab.tar.gz busybox-w32-c70a65f36c017f6feb7e86415bec1a644e71dbab.tar.bz2 busybox-w32-c70a65f36c017f6feb7e86415bec1a644e71dbab.zip | |
Merge branch 'busybox' into merge
Diffstat (limited to 'include')
| -rw-r--r-- | include/libbb.h | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/include/libbb.h b/include/libbb.h index 27c523cdf..4cacdacba 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
| @@ -2078,6 +2078,10 @@ int64_t windows_read_key(int fd, char *buffer, int timeout) FAST_FUNC; | |||
| 2078 | int64_t safe_read_key(int fd, char *buffer, int timeout) FAST_FUNC; | 2078 | int64_t safe_read_key(int fd, char *buffer, int timeout) FAST_FUNC; |
| 2079 | void read_key_ungets(char *buffer, const char *str, unsigned len) FAST_FUNC; | 2079 | void read_key_ungets(char *buffer, const char *str, unsigned len) FAST_FUNC; |
| 2080 | 2080 | ||
| 2081 | int check_got_signal_and_poll(struct pollfd pfd[1], int timeout) FAST_FUNC; | ||
| 2082 | #if ENABLE_PLATFORM_MINGW32 | ||
| 2083 | # define check_got_signal_and_poll(p, t) poll(p, 1, t) | ||
| 2084 | #endif | ||
| 2081 | 2085 | ||
| 2082 | #if ENABLE_FEATURE_EDITING | 2086 | #if ENABLE_FEATURE_EDITING |
| 2083 | /* It's NOT just ENABLEd or disabled. It's a number: */ | 2087 | /* It's NOT just ENABLEd or disabled. It's a number: */ |
| @@ -2124,7 +2128,7 @@ typedef struct line_input_t { | |||
| 2124 | # if MAX_HISTORY | 2128 | # if MAX_HISTORY |
| 2125 | int cnt_history; | 2129 | int cnt_history; |
| 2126 | int cur_history; | 2130 | int cur_history; |
| 2127 | int max_history; /* must never be <= 0 */ | 2131 | int max_history; /* must never be < 0 */ |
| 2128 | # if ENABLE_FEATURE_EDITING_SAVEHISTORY | 2132 | # if ENABLE_FEATURE_EDITING_SAVEHISTORY |
| 2129 | /* meaning of this field depends on FEATURE_EDITING_SAVE_ON_EXIT: | 2133 | /* meaning of this field depends on FEATURE_EDITING_SAVE_ON_EXIT: |
| 2130 | * if !FEATURE_EDITING_SAVE_ON_EXIT: "how many lines are | 2134 | * if !FEATURE_EDITING_SAVE_ON_EXIT: "how many lines are |
| @@ -2547,31 +2551,10 @@ extern struct globals *BB_GLOBAL_CONST ptr_to_globals; | |||
| 2547 | #define barrier() asm volatile ("":::"memory") | 2551 | #define barrier() asm volatile ("":::"memory") |
| 2548 | 2552 | ||
| 2549 | #if defined(__clang_major__) && __clang_major__ >= 9 | 2553 | #if defined(__clang_major__) && __clang_major__ >= 9 |
| 2550 | /* Clang/llvm drops assignment to "constant" storage. Silently. | 2554 | /* {ASSIGN,XZALLOC}_CONST_PTR() are out-of-line functions |
| 2551 | * Needs serious convincing to not eliminate the store. | 2555 | * to prevent clang from reading pointer before it is assigned. |
| 2552 | */ | ||
| 2553 | static ALWAYS_INLINE void* not_const_pp(const void *p) | ||
| 2554 | { | ||
| 2555 | void *pp; | ||
| 2556 | asm volatile ( | ||
| 2557 | "# forget that p points to const" | ||
| 2558 | : /*outputs*/ "=r" (pp) | ||
| 2559 | : /*inputs*/ "0" (p) | ||
| 2560 | ); | ||
| 2561 | return pp; | ||
| 2562 | } | ||
| 2563 | # if !ENABLE_PLATFORM_MINGW32 | ||
| 2564 | # define ASSIGN_CONST_PTR(pptr, v) do { \ | ||
| 2565 | *(void**)not_const_pp(pptr) = (void*)(v); \ | ||
| 2566 | barrier(); \ | ||
| 2567 | } while (0) | ||
| 2568 | #else | ||
| 2569 | /* On Windows it seems necessary for this to be a function too. */ | ||
| 2570 | void ASSIGN_CONST_PTR(const void *pptr, const void *ptr) FAST_FUNC; | ||
| 2571 | #endif | ||
| 2572 | /* XZALLOC_CONST_PTR() is an out-of-line function to prevent | ||
| 2573 | * clang from reading pointer before it is assigned. | ||
| 2574 | */ | 2556 | */ |
| 2557 | void ASSIGN_CONST_PTR(const void *pptr, void *v) FAST_FUNC; | ||
| 2575 | void XZALLOC_CONST_PTR(const void *pptr, size_t size) FAST_FUNC; | 2558 | void XZALLOC_CONST_PTR(const void *pptr, size_t size) FAST_FUNC; |
| 2576 | #else | 2559 | #else |
| 2577 | # define ASSIGN_CONST_PTR(pptr, v) do { \ | 2560 | # define ASSIGN_CONST_PTR(pptr, v) do { \ |
