From 21edea68d2e46a135dcb148695b5fffea2b491db Mon Sep 17 00:00:00 2001 From: nakst <> Date: Wed, 27 Oct 2021 11:47:08 +0100 Subject: [PATCH] fixes for 32 bit --- apps/file_manager/ui.cpp | 4 +- apps/system_monitor.cpp | 22 +++---- desktop/os.header | 4 +- desktop/prefix.h | 12 ++++ desktop/text.cpp | 6 +- kernel/cache.cpp | 12 ++-- kernel/elf.cpp | 5 ++ kernel/files.cpp | 2 +- kernel/kernel.h | 4 +- kernel/memory.cpp | 6 +- kernel/objects.cpp | 4 +- kernel/syscall.cpp | 4 ++ kernel/windows.cpp | 6 +- shared/common.cpp | 4 +- shared/math.cpp | 4 +- shared/unicode.cpp | 128 +++++++++++++++++++-------------------- util/build.c | 8 +++ 17 files changed, 133 insertions(+), 102 deletions(-) diff --git a/apps/file_manager/ui.cpp b/apps/file_manager/ui.cpp index 8110fee..705003d 100644 --- a/apps/file_manager/ui.cpp +++ b/apps/file_manager/ui.cpp @@ -17,8 +17,8 @@ void InstanceFolderPathChanged(Instance *instance, bool fromLoadFolder) { EsWindowSetTitle(instance->window, (char *) buffer.out, buffer.position); EsWindowSetIcon(instance->window, knownFileTypes[instance->folder->containerHandler->getFileType(instance->path)].iconID); - EsListViewEnumerateVisibleItems(instance->list, [] (EsListView *, EsElement *item, uint32_t, EsGeneric index) { - ListItemCreated(item, index.u, true); + EsListViewEnumerateVisibleItems(instance->list, [] (EsListView *, EsElement *item, uint32_t, EsListViewIndex index) { + ListItemCreated(item, index, true); }); } diff --git a/apps/system_monitor.cpp b/apps/system_monitor.cpp index a50f567..6a8bb16 100644 --- a/apps/system_monitor.cpp +++ b/apps/system_monitor.cpp @@ -23,20 +23,20 @@ struct Instance : EsInstance { #define DISPLAY_MEMORY (12) EsListViewColumn listViewProcessesColumns[] = { - { EsLiteral("Name"), 0, 150 }, - { EsLiteral("PID"), ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 120 }, - { EsLiteral("Memory"), ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 120 }, - { EsLiteral("CPU"), ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 120 }, - { EsLiteral("Handles"), ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 120 }, - { EsLiteral("Threads"), ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 120 }, + { "Name", -1, 0, 150 }, + { "PID", -1, ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 120 }, + { "Memory", -1, ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 120 }, + { "CPU", -1, ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 120 }, + { "Handles", -1, ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 120 }, + { "Threads", -1, ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 120 }, }; EsListViewColumn listViewContextSwitchesColumns[] = { - { EsLiteral("Time stamp (ms)"), ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 150 }, - { EsLiteral("CPU"), ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 150 }, - { EsLiteral("Process"), 0, 150 }, - { EsLiteral("Thread"), 0, 150 }, - { EsLiteral("Count"), 0, 150 }, + { "Time stamp (ms)", -1, ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 150 }, + { "CPU", -1, ES_LIST_VIEW_COLUMN_RIGHT_ALIGNED, 150 }, + { "Process", -1, 0, 150 }, + { "Thread", -1, 0, 150 }, + { "Count", -1, 0, 150 }, }; const EsStyle styleMonospacedTextbox = { diff --git a/desktop/os.header b/desktop/os.header index c2eebde..889963b 100644 --- a/desktop/os.header +++ b/desktop/os.header @@ -413,7 +413,7 @@ define ES_MAP_OBJECT_READ_WRITE (0) define ES_MAP_OBJECT_READ_ONLY (1) define ES_MAP_OBJECT_COPY_ON_WRITE (2) -define ES_STRING_FORMAT_ENOUGH_SPACE ((_EsLongConstant) (-1)) +define ES_STRING_FORMAT_ENOUGH_SPACE (-1) // Flags set with %f. define ES_STRING_FORMAT_SIMPLE (1 << 0) @@ -1950,7 +1950,7 @@ function_pointer void EsMenuCallback(EsMenu *menu, EsGeneric context); function_pointer void EsUndoCallback(const void *item, EsUndoManager *manager, EsMessage *message); function_pointer void EsMountPointEnumerationCallback(const char *prefix, size_t prefixBytes, EsGeneric context); function_pointer void EsDeviceEnumerationCallback(EsMessageDevice device, EsGeneric context); -function_pointer void EsListViewEnumerateVisibleItemsCallback(EsListView *view, EsElement *item, uint32_t group, EsGeneric index); +function_pointer void EsListViewEnumerateVisibleItemsCallback(EsListView *view, EsElement *item, uint32_t group, EsListViewIndex index); function_pointer void EsFontEnumerationCallback(const EsFontInformation *information, EsGeneric context); function_pointer void EsUserTaskCallback(EsUserTask *task, EsGeneric data); function_pointer bool EsFileCopyCallback(EsFileOffset bytesCopied, EsFileOffset totalBytes, EsGeneric data); // Return false to cancel. diff --git a/desktop/prefix.h b/desktop/prefix.h index 4e54f68..09aa955 100644 --- a/desktop/prefix.h +++ b/desktop/prefix.h @@ -76,6 +76,13 @@ ES_EXTERN_C __attribute__((noreturn)) void _EsCRTlongjmp(EsCRTjmp_buf *env, int #define EsCRTlongjmp(x, y) _EsCRTlongjmp(&(x), (y)) #endif +#ifdef ARCH_X86_32 +#define ES_API_BASE ((void **) 0x1000) +#define ES_SHARED_MEMORY_MAXIMUM_SIZE ((size_t) 1024 * 1024 * 1024) +#define ES_PAGE_SIZE ((uintptr_t) 4096) +#define ES_PAGE_BITS (12) +#endif + #define _ES_C_PREPROCESSOR_JOIN(x, y) x ## y #define ES_C_PREPROCESSOR_JOIN(x, y) _ES_C_PREPROCESSOR_JOIN(x, y) @@ -259,6 +266,11 @@ struct _EsPOSIXSyscall { #define BUNDLE_FILE_DESKTOP_MAP_ADDRESS (0xF0000000UL) #endif +#ifdef ARCH_X86_32 +#define BUNDLE_FILE_MAP_ADDRESS (0xA0000000UL) +#define BUNDLE_FILE_DESKTOP_MAP_ADDRESS (0xBC000000UL) +#endif + struct BundleHeader { #define BUNDLE_SIGNATURE (0x63BDAF45) uint32_t signature; diff --git a/desktop/text.cpp b/desktop/text.cpp index a1f68d7..564eadd 100644 --- a/desktop/text.cpp +++ b/desktop/text.cpp @@ -2352,11 +2352,11 @@ void DrawTextPiece(EsPainter *painter, EsTextPlan *plan, TextPiece *piece, TextL int sCursorX = cursorX, selectionStartX = -1, selectionEndX = -1; for (uintptr_t i = 0; i < piece->glyphCount; i++) { - if (selectionStartX == -1 && glyphs[i].cluster >= selection->caret0) { + if (selectionStartX == -1 && (int32_t) glyphs[i].cluster >= selection->caret0) { selectionStartX = sCursorX; } - if (selectionEndX == -1 && glyphs[i].cluster >= selection->caret1) { + if (selectionEndX == -1 && (int32_t) glyphs[i].cluster >= selection->caret1) { selectionEndX = sCursorX; } @@ -2431,7 +2431,7 @@ void DrawTextPiece(EsPainter *painter, EsTextPlan *plan, TextPiece *piece, TextL } if (selection->caret0 != selection->caret1 && !selection->hideCaret - && glyphs[i].cluster >= selection->caret0 && glyphs[i].cluster < selection->caret1 + && (int32_t) glyphs[i].cluster >= selection->caret0 && (int32_t) glyphs[i].cluster < selection->caret1 && selection->foreground) { color = selection->foreground; } diff --git a/kernel/cache.cpp b/kernel/cache.cpp index 7a5fa2f..eb55902 100644 --- a/kernel/cache.cpp +++ b/kernel/cache.cpp @@ -112,8 +112,8 @@ bool CCSpaceCover(CCSpace *cache, EsFileOffset insertStart, EsFileOffset insertE // TODO Test this thoroughly. // TODO Break up really large sections. (maybe into GBs?) - insertStart = RoundDown(insertStart, K_PAGE_SIZE); - insertEnd = RoundUp(insertEnd, K_PAGE_SIZE); + insertStart = RoundDown(insertStart, (EsFileOffset) K_PAGE_SIZE); + insertEnd = RoundUp(insertEnd, (EsFileOffset) K_PAGE_SIZE); EsFileOffset position = insertStart, lastEnd = 0; CCCachedSection *result = nullptr; @@ -209,8 +209,8 @@ bool CCSpaceCover(CCSpace *cache, EsFileOffset insertStart, EsFileOffset insertE void CCSpaceUncover(CCSpace *cache, EsFileOffset removeStart, EsFileOffset removeEnd) { KMutexAssertLocked(&cache->cachedSectionsMutex); - removeStart = RoundDown(removeStart, K_PAGE_SIZE); - removeEnd = RoundUp(removeEnd, K_PAGE_SIZE); + removeStart = RoundDown(removeStart, (EsFileOffset) K_PAGE_SIZE); + removeEnd = RoundUp(removeEnd, (EsFileOffset) K_PAGE_SIZE); CCCachedSection *first = CCFindCachedSectionContaining(cache, removeStart); @@ -678,8 +678,8 @@ EsError CCSpaceAccess(CCSpace *cache, K_USER_BUFFER void *_buffer, EsFileOffset EsFileOffset start = sectionOffset < offset ? offset - sectionOffset : 0; EsFileOffset end = sectionOffset + CC_ACTIVE_SECTION_SIZE > offset + count ? offset + count - sectionOffset : CC_ACTIVE_SECTION_SIZE; - EsFileOffset pageStart = RoundDown(start, K_PAGE_SIZE) / K_PAGE_SIZE; - EsFileOffset pageEnd = RoundUp(end, K_PAGE_SIZE) / K_PAGE_SIZE; + EsFileOffset pageStart = RoundDown(start, (EsFileOffset) K_PAGE_SIZE) / K_PAGE_SIZE; + EsFileOffset pageEnd = RoundUp(end, (EsFileOffset) K_PAGE_SIZE) / K_PAGE_SIZE; // Find the section in the active sections list. diff --git a/kernel/elf.cpp b/kernel/elf.cpp index 8446f04..c0f24b3 100644 --- a/kernel/elf.cpp +++ b/kernel/elf.cpp @@ -297,6 +297,7 @@ uint8_t *AllocateForModule(size_t size) { } EsError KLoadELFModule(KModule *module) { +#ifdef ARCH_X86_64 KMutexAcquire(&modulesMutex); EsDefer(KMutexRelease(&modulesMutex)); @@ -403,6 +404,10 @@ EsError KLoadELFModule(KModule *module) { } return ES_SUCCESS; +#else + (void) module; + return ES_ERROR_UNSUPPORTED_FEATURE; +#endif } #endif diff --git a/kernel/files.cpp b/kernel/files.cpp index 1fde144..a3b0237 100644 --- a/kernel/files.cpp +++ b/kernel/files.cpp @@ -329,7 +329,7 @@ void _FSFileResize(FSFile *file, EsFileOffset newSize) { EsError FSFileResize(KNode *node, EsFileOffset newSize) { if (fs.shutdown) KernelPanic("FSFileResize - Attempting to resize a file after FSShutdown called.\n"); - if (newSize > 1UL << 60) { + if (newSize > (EsFileOffset) 1 << 60) { return ES_ERROR_INSUFFICIENT_RESOURCES; } diff --git a/kernel/kernel.h b/kernel/kernel.h index d0cdb49..ee606a2 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -68,8 +68,10 @@ // Core definitions. // --------------------------------------------------------------------------------------------------------------- -#ifdef ARCH_X86_64 +#if defined(ARCH_X86_64) #include "x86_64.cpp" +#elif defined(ARCH_X86_32) +#include "x86_32.cpp" #endif struct AsyncTask { diff --git a/kernel/memory.cpp b/kernel/memory.cpp index beb80ca..2569f01 100644 --- a/kernel/memory.cpp +++ b/kernel/memory.cpp @@ -1453,7 +1453,7 @@ void MMSharedDestroyRegion(MMSharedRegion *region) { EsHeapFree(region, 0, K_CORE); } -void *MMStandardAllocate(MMSpace *space, size_t bytes, unsigned flags, void *baseAddress, bool commitAll) { +void *MMStandardAllocate(MMSpace *space, size_t bytes, uint32_t flags, void *baseAddress, bool commitAll) { if (!space) space = kernelMMSpace; KMutexAcquire(&space->reserveMutex); @@ -1533,8 +1533,8 @@ bool MMFree(MMSpace *space, void *address, size_t expectedSize, bool userOnly) { unmapPages = false; FSFile *node = region->data.file.node; - EsFileOffset removeStart = RoundDown(region->data.file.offset, K_PAGE_SIZE); - EsFileOffset removeEnd = RoundUp(removeStart + (region->pageCount << K_PAGE_BITS) - region->data.file.zeroedBytes, K_PAGE_SIZE); + EsFileOffset removeStart = RoundDown(region->data.file.offset, (EsFileOffset) K_PAGE_SIZE); + EsFileOffset removeEnd = RoundUp(removeStart + (region->pageCount << K_PAGE_BITS) - region->data.file.zeroedBytes, (EsFileOffset) K_PAGE_SIZE); nodeToFree = node; fileHandleFlags = region->data.file.fileHandleFlags; diff --git a/kernel/objects.cpp b/kernel/objects.cpp index 4614d90..9dafd0d 100644 --- a/kernel/objects.cpp +++ b/kernel/objects.cpp @@ -14,8 +14,8 @@ struct Handle { struct ConstantBuffer { volatile size_t handles; - size_t bytes : 48, - isPaged : 1; + size_t bytes; + bool isPaged; // Data follows. }; diff --git a/kernel/syscall.cpp b/kernel/syscall.cpp index e06cbae..6a80852 100644 --- a/kernel/syscall.cpp +++ b/kernel/syscall.cpp @@ -886,7 +886,11 @@ SYSCALL_IMPLEMENT(ES_SYSCALL_EVENT_RESET) { SYSCALL_IMPLEMENT(ES_SYSCALL_SLEEP) { KTimer timer = {}; +#ifdef ARCH_64 KTimerSet(&timer, (argument0 << 32) | argument1); +#else + KTimerSet(&timer, argument1); +#endif currentThread->terminatableState = THREAD_USER_BLOCK_REQUEST; KEventWait(&timer.event, ES_WAIT_NO_TIMEOUT); currentThread->terminatableState = THREAD_IN_SYSCALL; diff --git a/kernel/windows.cpp b/kernel/windows.cpp index 4e06049..814f061 100644 --- a/kernel/windows.cpp +++ b/kernel/windows.cpp @@ -314,7 +314,7 @@ void WindowManager::EndEyedrop(bool cancelled) { Redraw(ES_POINT(0, 0), graphics.width, graphics.height); } -void WindowManager::PressKey(unsigned scancode) { +void WindowManager::PressKey(uint32_t scancode) { if (!initialised) { return; } @@ -541,7 +541,7 @@ bool WindowManager::ActivateWindow(Window *window) { return result; } -void WindowManager::ClickCursor(unsigned buttons) { +void WindowManager::ClickCursor(uint32_t buttons) { KMutexAcquire(&mutex); unsigned delta = lastButtons ^ buttons; @@ -1299,7 +1299,7 @@ void KMouseUpdate(const KMouseUpdateData *data) { windowManager.ClickCursor(data->buttons); } -void KKeyPress(unsigned scancode) { +void KKeyPress(uint32_t scancode) { windowManager.PressKey(scancode); } diff --git a/shared/common.cpp b/shared/common.cpp index 5a097e0..7aa3d4c 100644 --- a/shared/common.cpp +++ b/shared/common.cpp @@ -775,14 +775,14 @@ void StringFormatCallback(int character, void *_fsi) { size_t bytes = utf8_encode(character, data); if (fsi->buffer) { - if (fsi->bytesRemaining < bytes && fsi->bytesRemaining != ES_STRING_FORMAT_ENOUGH_SPACE) { + if (fsi->bytesRemaining < bytes && fsi->bytesRemaining != (size_t) ES_STRING_FORMAT_ENOUGH_SPACE) { fsi->full = true; return; } else { utf8_encode(character, fsi->buffer); fsi->buffer += bytes; fsi->bytesWritten += bytes; - if (fsi->bytesRemaining != ES_STRING_FORMAT_ENOUGH_SPACE) fsi->bytesRemaining -= bytes; + if (fsi->bytesRemaining != (size_t) ES_STRING_FORMAT_ENOUGH_SPACE) fsi->bytesRemaining -= bytes; } } } diff --git a/shared/math.cpp b/shared/math.cpp index 3b4a8a8..ad02b38 100644 --- a/shared/math.cpp +++ b/shared/math.cpp @@ -1110,7 +1110,7 @@ struct BigFloat { uint8_t carry = subtract ? 1 : 0; -#if 0 +#ifdef ARCH_32 for (intptr_t i = MANTISSA_BITS - 1; i >= 0; i--) { uint8_t xi = GET_MANTISSA_BIT(x, i); uint8_t yi = GET_MANTISSA_BIT(y, i); @@ -1134,7 +1134,7 @@ struct BigFloat { uint8_t carry = 1; -#if 0 +#ifdef ARCH_32 for (intptr_t i = MANTISSA_BITS - 1; i >= 0; i--) { uint8_t xi = GET_MANTISSA_BIT(x, i); uint8_t sum = xi + carry; diff --git a/shared/unicode.cpp b/shared/unicode.cpp index 3e3c4d5..542d0c2 100644 --- a/shared/unicode.cpp +++ b/shared/unicode.cpp @@ -990,70 +990,70 @@ struct BreakState { // --------------------------------- Validation. const uint64_t utf8ValidationStateTable[] = { - 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, - 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, - 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, - 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6D80, - 0xDB0AA4DB6DB6D80, 0xDB0AA4DB6DB6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036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, 0xDB0AA4306306036, - 0xDB0AA4DB6DB6DB6, 0xDB0AA4DB6DB6DB6, 0xDB0AA4DB6DB6D86, 0xDB0AA4DB6DB6D86, - 0xDB0AA4DB6DB6D86, 0xDB0AA4DB6DB6D86, 0xDB0AA4DB6DB6D86, 0xDB0AA4DB6DB6D86, - 0xDB0AA4DB6DB6D86, 0xDB0AA4DB6DB6D86, 0xDB0AA4DB6DB6D86, 0xDB0AA4DB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DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, + 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, + 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, + 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, + 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, + 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, + 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, + 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, 0xDB0AA4DB6DB6D80ULL, + 0xDB0AA4636306036ULL, 0xDB0AA4636306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, 0xDB0AA4306306036ULL, + 0xDB0AA4DB6DB6DB6ULL, 0xDB0AA4DB6DB6DB6ULL, 0xDB0AA4DB6DB6D86ULL, 0xDB0AA4DB6DB6D86ULL, + 0xDB0AA4DB6DB6D86ULL, 0xDB0AA4DB6DB6D86ULL, 0xDB0AA4DB6DB6D86ULL, 0xDB0AA4DB6DB6D86ULL, + 0xDB0AA4DB6DB6D86ULL, 0xDB0AA4DB6DB6D86ULL, 0xDB0AA4DB6DB6D86ULL, 0xDB0AA4DB6DB6D86ULL, + 0xDB0AA4DB6DB6D86ULL, 0xDB0AA4DB6DB6D86ULL, 0xDB0AA4DB6DB6D86ULL, 0xDB0AA4DB6DB6D86ULL, + 0xDB0AA4DB6DB6D86ULL, 0xDB0AA4DB6DB6D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899a 100644 --- a/util/build.c +++ b/util/build.c @@ -612,13 +612,21 @@ void BuildCrossCompiler() { { char *originalPath = getenv("PATH"); + if (strlen(originalPath) > 32768) { printf("PATH too long\n"); goto fail; } + strcpy(path, compilerPath); strcat(path, ":"); strcat(path, originalPath); + + if (strstr(path, "::")) { + printf("PATH contains double colon\n"); + goto fail; + } + setenv("PATH", path, 1); }