https://gitlab.synchro.net/main/sbbs/-/commit/e49f928b662f12224817a459
Added Files:
src/sbbs3/js_archive.cpp js_client.cpp js_com.cpp js_conio.cpp js_cryptcert.cpp js_cryptcon.cpp js_cryptkeyset.cpp js_file.cpp js_file_area.cpp js_filebase.cpp js_global.cpp js_internal.cpp js_main.cpp js_mqtt.cpp js_msg_area.cpp js_msgbase.cpp js_queue.cpp js_request.cpp js_rtpool.cpp js_server.cpp js_socket.cpp js_sprintf.cpp js_system.cpp js_uifc.cpp js_user.cpp js_xtrn_area.cpp jsexec.cpp mailsrvr.cpp services.cpp websrvr.cpp
Modified Files:
src/sbbs3/js_bbs.cpp jsdebug.h jsexec.vcxproj logfile.cpp logfile.h mailsrvr.vcxproj main.cpp mime.h sbbs.h sbbs.vcxproj scfgdefs.h services.vcxproj ver.cpp websrvr.vcxproj
Log Message:
Convert all C source files that use JavaScript (libmozjs) to C++
C++ is a prerequisite for all modern versions of libmozjs (SpiderMonkey).
This commit is *not* updating libmozjs, it's just doing the C->C++ conversion using the minimum number of changes to get it to compile and run as before using MSVC Version 19.44.35217 and GCC 11.4.0. There are still some new warnings now however.
In general, MSVC was more permissive than GCC/G++.
This commit consists of renaming of files and resovling errors and warnings:
- More typecasts (preferring static_cast<> where possible, mostly)
- More proper constification (of char *'s)
Detecting C++ compilation no can be used to infer "sbbs/Terminal Server" as JSexec and all of the other servers (except the FTP server) are now C++ as well. This required linking the (new) SFTP library into other server projects <shrug>.
There is a concern with services.cpp and a potential (new) memory leak with
the protected_uint32_t clients member of service_t. This is now an _Atomic
type in C++ which doesn't have a copy or move constructor so manual allocation was required and we're probably not deleting/freeing it entirely upon shutdown or recycle. Need to follow-up on that.
After this (more C++ heavy) build is determined to be solid, we can start tackling the next steps in upgading libmozjs (likely version 78).
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net