summaryrefslogtreecommitdiff
path: root/drivers/unix
AgeCommit message (Collapse)Author
2021-04-27Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde
We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.
2021-04-27Merge pull request #47398 from Faless/feature/network-local-port-salvagedRémi Verschelde
2021-04-26[Net] Fix socket poll timeout on Windows.Fabio Alessandrelli
Now correctly computes the timeout value in milliseconds.
2021-04-12Allow local port control on net_socket connectionsdam
2021-03-23FileDialog: add Back/Forward buttons, add message for inaccessible folders.bruvzg
2021-03-16Allow nullptr with zero length in FileAccess get_bufferAlex Hirsch
fix #47071
2021-03-14Thread: Re-add pthread_np.h include for FreeBSD/OpenBSDRémi Verschelde
Was a regression from #45315. Fixes #46998.
2021-03-09Add parameter checkes to FileAccess get_buffer functionsAlex Hirsch
fix #46540
2021-01-31Merge pull request #45315 from RandomShaper/modernize_threadRémi Verschelde
Modernize Thread
2021-01-29Modernize ThreadPedro J. Estébanez
- Based on C++11's `thread` and `thread_local` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed (except for the few cases of non-portable functions) - Simpler for `NO_THREADS` - Thread ids are now the same across platforms (main is 1; others follow)
2021-01-28Unify URI encoding/decoding and add to C#Aaron Franke
http_escape and percent_encode have been unified into uri_encode, and http_unescape and percent_decode have been unified into uri_decode.
2021-01-19Modernize RWLockPedro J. Estébanez
- Based on C++14's `shared_time_mutex` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed - Simpler for `NO_THREADS`
2021-01-13Merge pull request #45157 from madmiraal/fix-44514Rémi Verschelde
Raise SIGKILL instead of CRASH_NOW in child process when fork fails
2021-01-13Raise SIGKILL instead of CRASH_NOW in child process when fork failsMarcel Admiraal
2021-01-13Fix OS::execute() and OS::create_process() command line argument CharStrings ↵bruvzg
freed before use.
2021-01-12Merge pull request #44514 from madmiraal/split-os-executeRémi Verschelde
Split OS::execute into two methods
2021-01-11Merge pull request #42740 from lolleko/fix-nanosleep-usageRémi Verschelde
Fix nanosleep usage
2021-01-09Split OS::execute into two methodsMarcel Admiraal
1. execute(): Executes a command and returns the results. 2. create_process(): Creates a new process and returns the new process' id.
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-12-17Add override keywords to core/os.h derived classes.Marcel Admiraal
2020-12-06Remove now unused FileAccessBuffered.Fabio Alessandrelli
2020-11-23Initialize class/struct variables with default values in core/ and drivers/Rafał Mikrut
2020-11-20doc: Warn about using Node internal processingRémi Verschelde
See #43689. Also 'fixed' some spelling for behavior in publicly visible strings. (Sorry en_GB, en_CA, en_AU, and more... Silicon Valley won the tech spelling war.)
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-10-24Fix wrong exit code being returnedEv1lbl0w
2020-10-12Fix nanosleep usageLorenz Junglas
nanosleep returns 0 or -1 not the error code. The error code "EINTR" (if encountered) is placed in errno, in which case nanosleep can be safely recalled with the remaining time. This is required, so that nanosleep continues if the calling thread is interrupted by a signal. See manpage nanosleep(2) for additional details.
2020-09-28Hides special folders in FileDialog for macOSHaoyu Qiu
2020-09-18NetBSD: Implement OS_Unix::get_executable_path()Rémi Verschelde
Same implementation as OpenBSD seems to work fine.
2020-09-18Linux/BSD: Fix support for NetBSDRémi Verschelde
Add __NetBSD__ to `platform_config.h` so that it can find `alloca` and use the proper `pthread_setname_np` format. Rename RANDOM_MAX to avoid conflict with NetBSD stdlib. Fixes #42145.
2020-09-04Replace calls to gmtime with gmtime_r and localtime with localtime_r.Marcel Admiraal
2020-09-03[Complex Test Layouts] Change `String` to use UTF-32 encoding on all platforms.bruvzg
2020-08-11[macOS] Fix crash on failed `fork`.bruvzg
2020-07-10Add override keywords.Marcel Admiraal
2020-07-01Merge pull request #38713 from aaronfranke/string-64bitRémi Verschelde
Make all String integer conversion methods be 64-bit
2020-06-03Remove 32-bit String to_int methodAaron Franke
2020-05-31Remove OS.get_system_time_secs/get_system_time_msecs and change ↵Emmanuel Leblond
OS.get_unix_time return type to double
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: Enforce separation line between function definitionsRémi Verschelde
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-05-14Enforce use of bool literals instead of integersRémi Verschelde
Using clang-tidy's `modernize-use-bool-literals`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html
2020-05-14Port member initialization from constructor to declaration (C++11)Rémi Verschelde
Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
2020-05-10Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde
Part of #33027.
2020-05-10Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde
Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-30SCons: Format buildsystem files with psf/blackRémi Verschelde
Configured for a max line length of 120 characters. psf/black is very opinionated and purposely doesn't leave much room for configuration. The output is mostly OK so that should be fine for us, but some things worth noting: - Manually wrapped strings will be reflowed, so by using a line length of 120 for the sake of preserving readability for our long command calls, it also means that some manually wrapped strings are back on the same line and should be manually merged again. - Code generators using string concatenation extensively look awful, since black puts each operand on a single line. We need to refactor these generators to use more pythonic string formatting, for which many options are available (`%`, `format` or f-strings). - CI checks and a pre-commit hook will be added to ensure that future buildsystem changes are well-formatted.
2020-03-27Renaming of servers for coherency.Juan Linietsky
VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
2020-03-21Make file formatting comply with POSIX and Unix standardsAaron Franke
UTF-8, LF, no BOM, and newlines at the end of files
2020-03-08Refactor ScriptDebugger.Fabio Alessandrelli
EngineDebugger is the new interface to access the debugger. It tries to be as agnostic as possible on the data that various subsystems can expose. It allows 2 types of interactions: - Profilers: A subsystem can register a profiler, assigning it a unique name. That name can be used to activate the profiler or add data to it. The registered profiler can be composed of up to 3 functions: - Toggle: called when the profiler is activated/deactivated. - Add: called whenever data is added to the debugger (via `EngineDebugger::profiler_add_frame_data`) - Tick: called every frame (during idle), receives frame times. - Captures: (Only relevant in remote debugger for now) A subsystem can register a capture, assigning it a unique name. When receiving a message, the remote debugger will check if it starts with `[prefix]:` and call the associated capture with name `prefix`. Port MultiplayerAPI, Servers, Scripts, Visual, Performance to the new profiler system. Port SceneDebugger and RemoteDebugger to the new capture system. The LocalDebugger also uses the new profiler system for scripts profiling.
2020-03-05Merge pull request #36752 from RandomShaper/rework_semaphoreRémi Verschelde
Drop old semaphore implementation
2020-03-04Merge pull request #36069 from RandomShaper/imvu/improve_drives_uxRémi Verschelde
Improve UX of drive letters