Conversation
sclaiborne
left a comment
There was a problem hiding this comment.
- Can you clarify why arm is not supported?
- Is it okay to add rtk lib to public repo?
It throws compile errors when I try to build with these two function on ARM with GCC 11
It's included in AS.. so I assume it OK? Turns out it's always been in there. "C:\BrAutomation\AS\System\C0463\SG4\IA32.." has a bunch of .a libraries. This is just a way to get AS to link against it automagically |
|
I could see removing the headers from RTK |
I am not sure what the right decision is there |
There was a problem hiding this comment.
Pull request overview
This PR begins adding Automation Studio 6 (AS6) support by adjusting the StringExt library for AS6/ARM constraints and introducing a new AS6 example project (including required library stubs/binaries) to build/run on Intel and ARM targets.
Changes:
- Gate/remove unsupported time parsing/formatting calls for ARM builds.
- Remove in-tree TLSF malloc redirection from
StringExtand introduce a separate TLSF binary library in the AS6 example project. - Add a full AS6 example Automation Studio project structure (Physical/Logical configs, bundled runtime/rtk headers and binaries).
Reviewed changes
Copilot reviewed 152 out of 160 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Ar/StringExt/time.cpp | ARM gating for gmtime_r/strptime. |
| src/Ar/StringExt/internal.c | Locking stubs changed to no-ops. |
| src/Ar/StringExt/heap_redirect.c | Removes TLSF malloc/free overrides; keeps dummy heap symbol. |
| src/Ar/StringExt/gdtoa/misc.c | Removes gdtoa lock usage around shared globals. |
| src/Ar/StringExt/gdtoa/arith.h | Removes TLSF include/lock macros; keeps MULTIPLE_THREADS. |
| src/Ar/StringExt/ANSIC.lby | Bumps library version; removes tlsf.h object. |
| example/AsProject/Physical/Intel/5PC900_TS17_04/Cpu.pkg | Clears VC firmware version in example. |
| example/AsProject/AsProject.apj | Removes TechnologyPackages section. |
| example/As6Project/package.json | Adds AS6 example Node/LPM config. |
| example/As6Project/package-lock.json | Lockfile for AS6 example dependencies. |
| example/As6Project/README.md | Short README for AS6 example. |
| example/As6Project/Physical/Physical.pkg | Physical configs (Intel/ARM). |
| example/As6Project/Physical/Intel/Hardware.hwl | Intel topology. |
| example/As6Project/Physical/Intel/Hardware.hw | Intel hardware configuration (incl. services/users). |
| example/As6Project/Physical/Intel/Config.pkg | Intel configuration package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/mappVision/Package.pkg | Empty mappVision package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/mappView/Package.pkg | Empty mappView package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/mappServices/Package.pkg | Empty mappServices package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/mappMotion/Package.pkg | Empty mappMotion package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/mappControl/Package.pkg | Empty mappControl package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/mappCockpit/Package.pkg | Empty mappCockpit package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/UnitSystem/Package.pkg | Empty UnitSystem package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/TextSystem/Package.pkg | Empty TextSystem package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/PvMap.vvm | Empty PV map stub. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/IoMap.iom | Empty IO map stub. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.sw | Intel SW config + library refs. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.pkg | Intel CPU package + AR/GCC versions. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/Cpu.per | Empty permanent vars stub. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/Connectivity/Package.pkg | Connectivity package (OpcUaCs). |
| example/As6Project/Physical/Intel/5PC900_TS17_04/Connectivity/OpcUaCs/Package.pkg | Empty OpcUaCs package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/User.user | Default user config (Anonymous). |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/Role.role | Default roles config. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/Package.pkg | UserRoleSystem package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/UserRoleSystem/BRRole.brrole | BR roles config. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/TransportLayerSecurity/Package.pkg | Empty TLS package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Package.pkg | AccessAndSecurity package composition. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Firewall/Rules.firewallRules | Empty firewall rules config. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/Firewall/Package.pkg | Firewall package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/SoftwareCertificates/Package.pkg | Empty SoftwareCertificates package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/Package.pkg | ThirdPartyCertificates package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/Package.pkg | CertificateStore package composition. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/PrivateKeys/Package.pkg | Empty PrivateKeys package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/Package.pkg | OwnCertificates package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/OwnCertificates/Certificates/Package.pkg | Empty Certificates package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/CertificateSigningRequests/Package.pkg | Empty CSR package. |
| example/As6Project/Physical/Intel/5PC900_TS17_04/AccessAndSecurity/CertificateStore/CertificateRevocationLists/Package.pkg | Empty CRL package. |
| example/As6Project/Physical/ARM/X20CP0410/mappVision/Package.pkg | Empty mappVision package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/mappView/Package.pkg | Empty mappView package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/mappServices/Package.pkg | Empty mappServices package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/mappSafety/SafeCommissioning/Package.pkg | Empty SafeCommissioning package. |
| example/As6Project/Physical/ARM/X20CP0410/mappSafety/SafeApplication/Package.pkg | Empty SafeApplication package. |
| example/As6Project/Physical/ARM/X20CP0410/mappSafety/Package.pkg | mappSafety package composition. |
| example/As6Project/Physical/ARM/X20CP0410/mappMotion/Package.pkg | Empty mappMotion package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/mappControl/Package.pkg | Empty mappControl package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/mappCockpit/Package.pkg | Empty mappCockpit package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/UnitSystem/Package.pkg | Empty UnitSystem package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/TextSystem/Package.pkg | Empty TextSystem package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/PvMap.vvm | Empty PV map stub (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/IoMap.iom | Empty IO map stub (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/Cpu.sw | ARM SW config + library refs. |
| example/As6Project/Physical/ARM/X20CP0410/Cpu.pkg | ARM CPU package + AR/GCC versions. |
| example/As6Project/Physical/ARM/X20CP0410/Cpu.per | Empty permanent vars stub (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/Connectivity/Package.pkg | Empty Connectivity package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/User.user | Default user config (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/Role.role | Default roles config (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/Package.pkg | UserRoleSystem package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/UserRoleSystem/BRRole.brrole | BR roles config (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/TransportLayerSecurity/Package.pkg | Empty TLS package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Package.pkg | AccessAndSecurity package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Firewall/Rules.firewallRules | Empty firewall rules config (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/Firewall/Package.pkg | Firewall package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/SoftwareCertificates/Package.pkg | Empty SoftwareCertificates package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/ThirdPartyCertificates/Package.pkg | ThirdPartyCertificates package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/Package.pkg | CertificateStore composition (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/PrivateKeys/Package.pkg | Empty PrivateKeys package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/Package.pkg | OwnCertificates package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/OwnCertificates/Certificates/Package.pkg | Empty Certificates package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/CertificateSigningRequests/Package.pkg | Empty CSR package (ARM). |
| example/As6Project/Physical/ARM/X20CP0410/AccessAndSecurity/CertificateStore/CertificateRevocationLists/Package.pkg | Empty CRL package (ARM). |
| example/As6Project/Physical/ARM/Hardware.hwl | ARM topology. |
| example/As6Project/Physical/ARM/Hardware.hw | ARM hardware configuration. |
| example/As6Project/Physical/ARM/Config.pkg | ARM configuration package. |
| example/As6Project/Logical/Programs/Package.pkg | Programs package. |
| example/As6Project/Logical/Programs/Default/Variables.var | Example program variables. |
| example/As6Project/Logical/Programs/Default/Types.typ | Example program types. |
| example/As6Project/Logical/Programs/Default/Main.c | Example program code using stringdtoa. |
| example/As6Project/Logical/Programs/Default/ANSIC.prg | Program file list. |
| example/As6Project/Logical/Package.pkg | Logical root package. |
| example/As6Project/Logical/Libraries/_AS/runtime/runtime.var | Runtime constants. |
| example/As6Project/Logical/Libraries/_AS/runtime/runtime.typ | Runtime type definitions. |
| example/As6Project/Logical/Libraries/_AS/runtime/runtime.fun | Runtime function block stubs. |
| example/As6Project/Logical/Libraries/_AS/runtime/binary.lby | Runtime library descriptor. |
| example/As6Project/Logical/Libraries/_AS/runtime/SGC/runtime.h | Generated runtime header (SGC). |
| example/As6Project/Logical/Libraries/_AS/runtime/SG3/runtime.h | Generated runtime header (SG3). |
| example/As6Project/Logical/Libraries/_AS/astime/binary.lby | AsTime library descriptor. |
| example/As6Project/Logical/Libraries/_AS/astime/astime.var | AsTime constants. |
| example/As6Project/Logical/Libraries/_AS/astime/astime.typ | AsTime type definitions. |
| example/As6Project/Logical/Libraries/_AS/astime/SGC/astime.h | Generated AsTime header (SGC). |
| example/As6Project/Logical/Libraries/_AS/astime/SG4/astime.h | Generated AsTime header (SG4). |
| example/As6Project/Logical/Libraries/_AS/astime/SG3/astime.h | Generated AsTime header (SG3). |
| example/As6Project/Logical/Libraries/_AS/Package.pkg | _AS libraries package. |
| example/As6Project/Logical/Libraries/_AS/AsBrWStr/binary.lby | AsBrWStr library descriptor. |
| example/As6Project/Logical/Libraries/_AS/AsBrWStr/SGC/AsBrWStr.h | Generated AsBrWStr header (SGC). |
| example/As6Project/Logical/Libraries/_AS/AsBrWStr/SG4/AsBrWStr.h | Generated AsBrWStr header (SG4). |
| example/As6Project/Logical/Libraries/_AS/AsBrWStr/SG3/AsBrWStr.h | Generated AsBrWStr header (SG3). |
| example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.var | AsBrWStr constants. |
| example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.typ | AsBrWStr types placeholder. |
| example/As6Project/Logical/Libraries/_AS/AsBrWStr/AsBrWStr.fun | AsBrWStr function signatures. |
| example/As6Project/Logical/Libraries/_AS/AsBrStr/binary.lby | AsBrStr library descriptor. |
| example/As6Project/Logical/Libraries/_AS/AsBrStr/SGC/AsBrStr.h | Generated AsBrStr header (SGC). |
| example/As6Project/Logical/Libraries/_AS/AsBrStr/SG4/AsBrStr.h | Generated AsBrStr header (SG4). |
| example/As6Project/Logical/Libraries/_AS/AsBrStr/SG3/AsBrStr.h | Generated AsBrStr header (SG3). |
| example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.var | AsBrStr constants placeholder. |
| example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.typ | AsBrStr types placeholder. |
| example/As6Project/Logical/Libraries/_AS/AsBrStr/AsBrStr.fun | AsBrStr function signatures. |
| example/As6Project/Logical/Libraries/Package.pkg | Libraries root package. |
| example/As6Project/Logical/Libraries/Loupe/tlsf/tlsf.h | TLSF header formatting fix. |
| example/As6Project/Logical/Libraries/Loupe/tlsf/heap_redirect.c | TLSF malloc/free redirection. |
| example/As6Project/Logical/Libraries/Loupe/tlsf/Binary.lby | TLSF binary library descriptor. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTypes.h | RTK legacy types header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTimer.h | RTK timer API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkTask.h | RTK task API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkSemaphore.h | RTK semaphore API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkRtc.h | RTK RTC API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkPlainFifo.h | RTK plain FIFO API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkObject.h | RTK object API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkMisc.h | RTK misc API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkMemory.h | RTK memory API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkFifo.h | RTK FIFO API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkCriticalSection.h | RTK critical section header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtkBase.h | RTK base types/errors header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/rtk.h | RTK umbrella header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/pvElementIteratorApi.h | PV element iterator API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/iecType.h | IEC type enum header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/hostApi.h | Host API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyWriteApi.h | COSY write API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyReadApi.h | COSY read API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/cosyApi.h | COSY base API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/bootModeApi.h | Boot mode API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/arexport.h | Export/deprecation macros. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/arState.h | AR state/error mapping header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/arSocket.h | AR socket API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/arSelect.h | AR select API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/arNetworkConvert.h | AR network conversion header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/arInternetTypes.h | AR internet types header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/arErrno.h | AR errno definitions header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/SiosClock.h | SIOS clock API header. |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/SG4/librtk_lib.a | Bundled RTK binary (Intel). |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/SG4/ARM/librtk_lib.a | Bundled RTK binary (ARM). |
| example/As6Project/Logical/Libraries/Loupe/rtk_lib/Binary.lby | RTK binary library descriptor. |
| example/As6Project/Logical/Libraries/Loupe/Package.pkg | Loupe libraries package. |
| example/As6Project/Logical/Global.var | Global vars placeholder. |
| example/As6Project/Logical/Global.typ | Global types placeholder. |
| example/As6Project/AsProject.apj | AS6 project file. |
Files not reviewed (1)
- example/As6Project/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| @@ -404,12 +398,10 @@ pow5mult | |||
| break; | |||
| if ((p51 = p5->next) == 0) { | |||
| #ifdef MULTIPLE_THREADS | |||
| ACQUIRE_DTOA_LOCK(1); | |||
| if (!(p51 = p5->next)) { | |||
| p51 = p5->next = mult(p5,p5); | |||
| p51->next = 0; | |||
| } | |||
There was a problem hiding this comment.
With MULTIPLE_THREADS enabled, pow5mult lazily initializes and extends the shared p5s cache. The lock sections were removed here, so concurrent callers can race and corrupt p5s/next pointers (or leak/duplicate nodes). Please restore synchronization around p5s initialization/extension, or disable MULTIPLE_THREADS if this code is only ever called from a single task/thread.
| #define ENABLE_MULTITHREAD | ||
| #ifdef ENABLE_MULTITHREAD | ||
|
|
||
| #define MULTIPLE_THREADS | ||
|
|
||
| #define ACQUIRE_DTOA_LOCK(n) lockSelect(n) | ||
| #define FREE_DTOA_LOCK(n) freeSelect(n) | ||
|
|
There was a problem hiding this comment.
MULTIPLE_THREADS is defined here, but the required dtoa lock macros are no longer provided (and the underlying lock functions were made no-ops). This combination makes the gdtoa code unsafe under concurrent use. Either (1) remove/undefine MULTIPLE_THREADS (and any related enable flag) until a real lock implementation is available, or (2) reintroduce ACQUIRE_DTOA_LOCK/FREE_DTOA_LOCK backed by a working critical section/semaphore API.
| "dependencies": { | ||
| "@loupeteam/librarybuilderproject": "^0.3.0", | ||
| "@loupeteam/stringext": "^0.14.4" | ||
| } |
There was a problem hiding this comment.
This package.json declares the package name as @loupeteam/librarybuilderproject and also lists @loupeteam/librarybuilderproject as a dependency. That creates a self-dependency cycle and will break installs (or at minimum produce confusing resolution). Remove the self-dependency or rename the package so the dependency points at the intended external module.
| unsigned long stringfTime(unsigned long dest, unsigned long destSize, unsigned long format, DATE_AND_TIME time) { | ||
| if(!dest || !destSize || !format) return 0; // Return if null pointers or if destSize is 0 | ||
| tm t = {}; | ||
| #ifndef __arm__ | ||
| gmtime_r((time_t*)&time, &t); | ||
| #endif | ||
| return strftime((char*)dest, destSize, (char*)format, &t); |
There was a problem hiding this comment.
On ARM builds, gmtime_r is skipped so t remains zero-initialized; strftime will then format the epoch (1970-01-01...) regardless of the time input. If these APIs are unavailable on AS6/ARM, the function should fail deterministically (e.g., return 0) or use an AS-supported conversion path instead of silently producing incorrect output. Also, avoid casting &time to time_t*; copy into a time_t temporary and pass its address to gmtime_r to prevent type/size/alignment issues.
| <Parameter ID="FtpUsername1" Value="dev" /> | ||
| <Parameter ID="FtpUserPassword1" Value="NYwXHzz4INzZvtlFBMOTmjZqrH4JRkY3Uye1yrmlNSg=" Description="dev" /> | ||
| <Parameter ID="FtpUserSalt1" Value="s9/ksXy4" /> | ||
| <Parameter ID="FTPAccessRight1" Value="0" /> | ||
| <Parameter ID="FTPdevice1" Value="ALL" /> | ||
| <Parameter ID="SdmColor" Value="colorRGB" /> | ||
| <Parameter ID="ActivateFtpServer" Value="1" /> | ||
| <Parameter ID="ActivateWebServer" Value="1" /> | ||
| <Parameter ID="ActivateSdm" Value="1" /> |
There was a problem hiding this comment.
This hardware config commits a predefined FTP user and password hash/salt and enables FTP/Web servers. Even if intended for examples, shipping credentials and enabled services by default is a security footgun and can be mistaken for production-ready settings. Prefer removing credentials from the repo and/or disabling FTP/WebServer by default, with setup instructions in README.
| <?AutomationStudio FileVersion="4.9"?> | ||
| <Package xmlns="http://br-automation.co.at/AS/Package"> | ||
| <Objects> | ||
| <Object Type="Library" Language="ANSIC" Reference="true">..\..\src\Ar\stringext\ANSIC.lby</Object> |
There was a problem hiding this comment.
The Reference path uses src\Ar\stringext\ANSIC.lby (different casing than the actual src/Ar/StringExt/... directory). This can break builds on case-sensitive filesystems (and makes the reference brittle). Update the path to match the real directory casing.
| <Object Type="Library" Language="ANSIC" Reference="true">..\..\src\Ar\stringext\ANSIC.lby</Object> | |
| <Object Type="Library" Language="ANSIC" Reference="true">..\..\src\Ar\StringExt\ANSIC.lby</Object> |
| DATE_AND_TIME stringpTime(unsigned long src, unsigned long format) { | ||
| if(!src || !format) return 0; // Return if null pointers | ||
| tm t = {}; | ||
| #ifndef __arm__ | ||
| strptime((char*)src, (char*)format, &t); | ||
| #endif | ||
| return mktime(&t); |
There was a problem hiding this comment.
On ARM builds, strptime is skipped so t stays zero-initialized; mktime(&t) will then return the epoch regardless of the input string. If parsing is unsupported on AS6/ARM, please return an explicit failure value (and/or set an error) rather than returning a misleading timestamp.
| void lockSelect(n) { | ||
| if(n > (sizeof(criticalSection)/sizeof(criticalSection[0]) - 1)) return; | ||
| if(!criticalSection[n]) CREATE(0, 1, &criticalSection[n]); | ||
| RTK_ERROR err = ACQUIRE(criticalSection[n], 500L); | ||
| return; | ||
| } | ||
|
|
||
| void freeSelect(n) { | ||
| if(n > (sizeof(criticalSection)/sizeof(criticalSection[0]) - 1)) return; | ||
| if(!criticalSection[n]) return; | ||
| RTK_ERROR err = RELEASE(criticalSection[n]); | ||
| return; | ||
| } |
There was a problem hiding this comment.
lockSelect/freeSelect are now no-ops and still use an old-style K&R parameter list (void lockSelect(n)), which is invalid in C99/C11 and will not compile as C++. Please give the parameter an explicit type (e.g., int n) and either (a) provide a working synchronization implementation for gdtoa when multi-threading is enabled, or (b) remove/disable the multi-threaded mode so these functions aren’t needed.
| @@ -75,7 +74,6 @@ Balloc | |||
| rv->k = k; | |||
| rv->maxwds = x; | |||
| } | |||
| FREE_DTOA_LOCK(0); | |||
| rv->sign = rv->wds = 0; | |||
| return rv; | |||
| } | |||
| @@ -89,10 +87,8 @@ Bfree | |||
| #endif | |||
| { | |||
| if (v) { | |||
| ACQUIRE_DTOA_LOCK(0); | |||
| v->next = freelist[v->k]; | |||
| freelist[v->k] = v; | |||
| FREE_DTOA_LOCK(0); | |||
| } | |||
There was a problem hiding this comment.
The dtoa allocator uses shared globals (freelist, private memory pool state) and previously relied on ACQUIRE_DTOA_LOCK/FREE_DTOA_LOCK for thread safety. With the lock calls removed here, concurrent calls can corrupt the free list / pool state. Either reintroduce locking (and provide a working lock backend) or ensure MULTIPLE_THREADS is not defined so single-threaded assumptions hold.
What:
Start adding support for AS6
Notes:
This PR removes support for some time functions in ARM that don't appear to be supported. We might want to fix it.
This PR uses a new TLSF library that is yet unrelease.
This PR doesn't support auto building yet