Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix MSVC build: move table_b2a_base64 before inline functions
MSVC doesn't support forward declarations of arrays without explicit
size. Move the table definition before the inline functions that use
it, eliminating the need for a forward declaration.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
  • Loading branch information
gpshead and claude committed Dec 29, 2025
commit 573eaf3fb7d95b44a95225483eab26c09f757b67
7 changes: 2 additions & 5 deletions Modules/binascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ static const unsigned char table_a2b_base64[] = {
* This allows the compiler to better optimize the hot loops.
*/

/* Forward declaration for table defined after the inline functions */
static const unsigned char table_b2a_base64[];
static const unsigned char table_b2a_base64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

/* Encode 3 bytes into 4 base64 characters. */
static inline void
Expand Down Expand Up @@ -198,9 +198,6 @@ base64_decode_fast(const unsigned char *in, Py_ssize_t in_len,
return i * 4;
}

static const unsigned char table_b2a_base64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";


static const unsigned short crctab_hqx[256] = {
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
Expand Down
Loading