summaryrefslogtreecommitdiffstats
path: root/drivers/unix
Commit message (Collapse)AuthorAgeFilesLines
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-1/+2
| | | | | | | 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.
* Replace NULL with nullptrlupoDharkael2020-04-028-44/+44
|
* SCons: Format buildsystem files with psf/blackRémi Verschelde2020-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | 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.
* Renaming of servers for coherency.Juan Linietsky2020-03-271-1/+1
| | | | | | | | | | VisualServer -> RenderingServer PhysicsServer -> PhysicsServer3D Physics2DServer -> PhysicsServer2D NavigationServer -> NavigationServer3D Navigation2DServer -> NavigationServer2D Also renamed corresponding files.
* Make file formatting comply with POSIX and Unix standardsAaron Franke2020-03-211-1/+1
| | | | UTF-8, LF, no BOM, and newlines at the end of files
* Refactor ScriptDebugger.Fabio Alessandrelli2020-03-081-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #36752 from RandomShaper/rework_semaphoreRémi Verschelde2020-03-053-150/+0
|\ | | | | Drop old semaphore implementation
| * Drop old semaphore implementationPedro J. Estébanez2020-03-033-150/+0
| | | | | | | | | | | | | | | | | | | | | | | | - Removed platform-specific implementations. - Now all semaphores are in-object, unless they need to be conditionally created. - Similarly to `Mutex`, provided a dummy implementation for when `NO_THREADS` is defined. - Similarly to `Mutex`, methods are made `const` for easy use in such contexts. - Language bindings updated: `wait()` and `post()` are now `void`. - Language bindings updated: `try_wait()` added. Bonus: - Rewritten the `#ifdef` in `mutex.h` to meet the code style.
* | Merge pull request #36069 from RandomShaper/imvu/improve_drives_uxRémi Verschelde2020-03-042-2/+8
|\ \ | | | | | | Improve UX of drive letters
| * | Improve UX of drive lettersPedro J. Estébanez2020-03-032-2/+8
| |/ | | | | | | | | | | | | | | | | | | Namely, move the drive dropdown to just the left of the path text box and don't include the former in the latter. This improves the UX on Windows. In the UNIX case, since its concept of drives is (ab)used to provide shortcuts to useful paths, its dropdown is kept at the original location.
* / os: execute parse the command output from utf8Mateo Dev .592020-03-031-1/+1
|/
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-263-137/+0
| | | | | | | | | | | | | | | | Main: - It's now implemented thanks to `<mutex>`. No more platform-specific implementations. - `BinaryMutex` (non-recursive) is added, as an alternative for special cases. - Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes. - Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts. - A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this. - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`. - Thread-safe utilities are therefore simpler now. Misc.: - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same. - Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock). - `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
* Fix set_reuse_address on non-Windows platforms.Fabio Alessandrelli2020-02-191-2/+0
| | | | Broken after cae0d8853d7a373ad8720289c12c7c2e7b5ef240 .
* Merge pull request #36321 from Faless/net/win_tcp_noreuseRémi Verschelde2020-02-181-3/+10
|\ | | | | Disable NetSocket reuse address on Windows.
| * Disable NetSocket reuse address on Windows.Fabio Alessandrelli2020-02-181-3/+10
| | | | | | | | It actually means reuse port -.- ...
* | Add peek option to NetSocket recv_from.Fabio Alessandrelli2020-02-162-3/+3
|/
* Added a spinlock template as well as a thread work pool class.Juan Linietsky2020-02-112-3/+3
| | | | Also, optimized shader compilation to happen on threads.
* Merge pull request #35301 from Calinou/improve-console-error-loggingRémi Verschelde2020-02-101-13/+13
|\ | | | | Improve the console error logging appearance
| * Improve the console error logging appearanceHugo Locurcio2020-01-191-13/+13
| | | | | | | | | | | | | | This makes secondary information less visually prominent to improve overall readability. Various loggers were also tweaked for consistency.
* | Make `OS.execute()` blocking by default if not specifiedHugo Locurcio2020-01-231-1/+1
|/ | | | | This makes `OS.execute()` calls quicker to set up when calling programs in a blocking fashion.
* Disable colored console output when standard output isn't a TTYHugo Locurcio2020-01-041-8/+24
| | | | | This prevents Godot from writing ANSI escape codes when redirecting stdout and stderr to a file.
* Update copyright statements to 2020Rémi Verschelde2020-01-0120-40/+40
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Make NetSockets quiter.Fabio Alessandrelli2019-12-172-15/+35
| | | | Use print_verbose instead of ERR_* for network errors.
* UDP sockets broadcast is now disabled by default.Fabio Alessandrelli2019-12-141-4/+6
| | | | | Add method `set_broadcast_enabled` to allow enabling broadcast via GDScript.
* NetSocket set_broadcast_enabled returns Error enumFabio Alessandrelli2019-12-102-4/+6
|
* Fix some crashes, overflows and using variables without valuesRafał Mikrut2019-11-011-0/+1
|
* Merge pull request #32617 from Faless/fix/fopen_close_execRémi Verschelde2019-10-261-4/+23
|\ | | | | Disable file descriptor sharing with subprocs.
| * Disable file descriptor sharing with subprocs.Fabio Alessandrelli2019-10-071-4/+23
| | | | | | | | | | | | | | | | | | On Unix systems, file descriptors are usually shared among child processes. This means, that if we spawn a subprocess (or we fork) like we do in the editor any open file descriptor will leak to the new process. This PR sets the close-on-exec flag when opening a file, which causes the file descriptor to not be shared with the child process.
* | Use WSAConnect instead of connect on Windows.Fabio Alessandrelli2019-10-251-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The misterious windows networking stack... Using connect instead of WSAConnect causes socket error 10022 under certain conditions. See: https://github.com/godotengine/webrtc-native/ (issue 6) Having to guess, code path for connect is different then WSAConnect with NULL extra parameters. The only reference about weird error with this code mentions something called "Windows Filtering Platform" but windows internals are, as always, obscure. This might be something to try and report to Microsoft if anyone has the time to spare with the likely outcome of being ignored.
* | Fix compilation warnings in macOS build, enable `warnings=extra werror=yes` ↵bruvzg2019-10-243-2/+4
| | | | | | | | for macOS CI.
* | Merge pull request #32616 from Faless/net/fix_close_execRémi Verschelde2019-10-082-0/+19
|\ \ | | | | | | Disable socket descriptor sharing with subprocs.
| * | Disable socket descriptor sharing with subprocs.Fabio Alessandrelli2019-10-072-0/+19
| |/ | | | | | | | | | | | | | | | | On Unix systems, sockets are like file descriptors, and file descriptors are usually shared among child processes. This means, that if we spawn a subprocess (or we fork) like we do in the editor, open file descriptors will leak to the new process. This causes issue with sockets as they might remain open and bound (listening) when the original process closes.
* | Merge pull request #32454 from jeronimo-schreyer/disable_unix_socketRémi Verschelde2019-10-081-0/+2
|\ \ | |/ |/| Optional Unix Socket disable for devices that do not support it
| * Optional Unix Socket disable for devices that do not support itJairo2019-09-301-0/+2
| |
* | IP: Fix build error on UWPRémi Verschelde2019-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | Fixes this error: ``` drivers\unix\ip_unix.cpp(155): error C2593: 'operator =' is ambiguous .\core/ustring.h(177): note: could be 'void String::operator =(const CharType *)' .\core/ustring.h(176): note: or 'void String::operator =(const char *)' drivers\unix\ip_unix.cpp(155): note: while trying to match the argument list '(String, int)' ```
* | Fix casting to uint64_t when returning unix system timeKanabenki2019-10-011-1/+1
| |
* | Added an exit code to the blocking mode of OS::executeRuslan Mullayanov2019-09-261-1/+1
| | | | | | | | | | | | Updated documentation accordingly. Fixes #31881.
* | Added some obvious errors explanationsqarmin2019-09-252-12/+13
|/
* Support for file not found in ConfigFile::Load and handle a few specific casesPouleyKetchoupp2019-08-211-2/+11
| | | | | | | EditorSettings::set_project_metadata: creates project_metadata.cfg if it doesn't exist EditorPlugin::get_config: removed (not used) Fixes #31444
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily2019-08-173-21/+9
| | | | | | | | | Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
* Remove redundant author doc commentsIAmActuallyCthulhu2019-08-125-19/+1
|
* Optimize DirAccessUnix::get_next() for some file systemsHadrien2019-07-291-18/+13
| | | | | | | | | On some file systems, like ext4 on Linux, readdir() gives enough information to determine the entry type in order to avoid doing a stat() system call. Use this information and call stat() only if necessary: for file systems that do not support this feature and for links.
* Revert "Optimize DirAccessUnix::get_next() for some file systems"Geequlim2019-07-211-14/+10
|
* Optimize DirAccessUnix::get_next() for some file systemsHadrien2019-07-171-10/+14
| | | | | | | | On some file systems, like ext4 on Linux, readdir() gives enough information to determine the entry type in order to avoid doing a stat() system call. Use this information and call stat() only if necessary.
* Use reference to constant in functionsqarmin2019-07-102-2/+2
|
* Fixes minor issues found by static analyzerqarmin2019-07-071-1/+1
|
* Merge pull request #30126 from qarmin/remove_unnecessary_codeRémi Verschelde2019-07-011-4/+4
|\ | | | | Remove unnecessary code and add some error explanations
| * Remove unnecessary code and add some error explanationsqarmin2019-07-011-4/+4
| |
* | Merge pull request #29815 from NilsIrl/plus_file_1Rémi Verschelde2019-07-011-1/+1
|\ \ | | | | | | Replace ` + "/" + ` with `String::file_add()`
| * | Replace ` + "/" + ` with `String::file_add()`Nils ANDRÉ-CHANG2019-06-231-1/+1
| | |