summaryrefslogtreecommitdiff
path: root/drivers/unix
AgeCommit message (Collapse)Author
2022-10-18Unify usage of GLOBAL/EDITOR_GETkobewi
2022-10-11Merge pull request #66102 from MJacred/feature/getvideoadapterdriverinfoRémi Verschelde
Fetch video adapter driver name and version from OS
2022-10-11Fetch video adapter driver name and version from OS on Linux/*BSD and WindowsMJacred
2022-10-11Cleanup unused defines in platform codeRémi Verschelde
2022-10-10SCons: Cleanup GCC warnings configurationRémi Verschelde
- Outright disable spammy warnings due to past or present GCC bugs: * `-Wno-strict-overflow` for GCC 7. * `-Wno-type-limits` for GCC before 11 (regressed in 9/10, might work in earlier releases but at this stage we don't care). * `-Wno-return-type` for GCC 12/13 (regression, still not fixed). - Enable extra warnings conditionally when broken on earlier GCC: * `-Wnoexcept` was removed due to an upstream regression in GCC 9, could be re-enabled (but commented out for now as we actually have `-Wnoexcept` warnings to fix. * `-Wlogical-op` was broken on our variadic templates before GCC 11, now seems fine.
2022-10-06Merge pull request #64815 from RandomShaper/default_cpu_countRémi Verschelde
Improve default `OS`'s CPU count getter
2022-10-05Keep a single, portable implementation of `OS::get_processor_count()`Pedro J. Estébanez
2022-10-05Merge pull request #66720 from qarmin/unintialized_memoryRémi Verschelde
Remove usage of unitialized variables
2022-10-05Merge pull request #64819 from RandomShaper/enhance_thread_funcsRémi Verschelde
Enhance portability of threading
2022-10-04Enhance portability of threadingPedro J. Estébanez
2022-10-04Merge pull request #66807 from ↵Rémi Verschelde
akien-mga/core-unix-remove-NO_FCNTL-and-NO_STATVFS Unix: Remove now unnecessary I/O defines, cleanup
2022-10-03Unix: Remove now unnecessary I/O defines, cleanupRémi Verschelde
- `LIBC_FILEIO_ENABLED` wasn't defined anywhere, even in _other platforms_. - `NO_NETWORK` is also never defined. It probably isn't enough anyway to disable network APIs in the current codebase. - `UNIX_SOCKET_UNAVAILABLE` is never defined in this code but used by some other platforms, clarify that. - `NO_STATVFS` can be removed as Android supports it since API level 19, which is our current min SDK level. It's also only used for `DirAccessUnix::get_space_left()` which is anyway overridden by `DirAccessJAndroid::get_space_left()` so it shouldn't make a difference. * Fixed documentation for `DirAccess.get_space_left()`. - `NO_FCNTL` is likely also a remnant of early Android days, in current NDK r23 it seems to be available. Also cleaned up unused `fcntl.h` includes. - `NO_ALLOCA` is never defined, and we use alloca in many places now.
2022-10-03Remove NO_THREADS fallback code, Godot 4 requires thread supportRémi Verschelde
This also removes `OS::can_use_threads` from the public API since it's always true.
2022-10-01Remove usage of unitialized variablesRafał Mikrut
2022-09-23SCons: Cleanup `DEBUG`, `_DEBUG` and `NDEBUG` definesRémi Verschelde
- `_DEBUG` is MSVC specific so it didn't make much sense to define for Android and iOS builds. - iOS was the only platform to define `DEBUG`. We don't use it anywhere outside thirdparty code, which we usually don't intend to debug, so it seems better to be consistent with other platforms. - Consistently define `NDEBUG` to disable assert behavior in both `release` and `release_debug` targets. This used to be set for `release` for all platforms, and `release_debug` for Android and iOS only. - Due to the above, I removed the only use we made of `assert()` in Godot code, which was only implemented for Unix anyway, should have been `DEV_ENABLED`, and is in PoolAllocator which we don't actually use. - The denoise and recast modules keep defining `NDEBUG` even for the `debug` target as we don't want OIDN and Embree asserting all over the place.
2022-09-19Replace File/Directory with FileAccess/DirAccesskobewi
2022-09-16Add get_distribution_name() and get_version() to OSMJacred
supports: LinuxBSD, Windows, macOS, iOS, Android, UWP Co-authored-by: bruvzg
2022-09-10Fixes #65377: get_datetime_* functions can return wrong valuesJames
2022-08-29Rename String `plus_file` to `path_join`Aaron Franke
2022-08-29[Web] Rename JavaScript platform to Web.Fabio Alessandrelli
Also rename export name from "HTML5" to "Web".
2022-08-05[Net] IP uses print_verbose when getaddrinfo fails.Fabio Alessandrelli
Avoid spamming errors when network is disconnected. Returned address will be invalid, so it can be checked by the user via `ret.is_valid_ip_address`.
2022-08-02Add override keywords to DirAccess derived classesMarcel Admiraal
2022-08-02Add override keywords to FileAccess derived classesMarcel Admiraal
2022-07-25Code quality: Fix header guards consistencyRémi Verschelde
Adds `header_guards.sh` bash script, used in CI to validate future changes. Can be run locally to fix invalid header guards.
2022-07-21Rename OSX to macOS and iPhoneOS to iOS.bruvzg
2022-07-07Allows parsing of invalid UTF-16 surrogates (can be encountered in Windows ↵bruvzg
filenames) and some non-standard UTF-8 variants, makes Unicode parse errors more verbose.
2022-07-05Add Desktop to file dialog drive on UnixShlomi
2022-07-05Add full support for Android scoped storage.Fredia Huya-Kouadio
This was done by refactoring directory and file access handling for the Android platform so that any general filesystem access type go through the Android layer. This allows us to validate whether the access is unrestricted, or whether it falls under scoped storage and thus act appropriately.
2022-05-16Replace most uses of Map by HashMapreduz
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
2022-05-03Add OS::is_process_running function.mdavisprog
Adds the is_process_running function to the native OS class and exposes it to script. This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function. Documentation is updated to reflect new API function.
2022-05-03Merge pull request #60601 from touilleMan/gdextension_get_library_pathRémi Verschelde
Add GDNativeInterface::get_library_path to GDExtension
2022-05-02Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`Rémi Verschelde
Didn't commit all the changes where it wants to initialize a struct with `{}`. Should be reviewed in a separate PR. Option `IgnoreArrays` enabled for now to be conservative, can be disabled to see if it proposes more useful changes. Also fixed manually a handful of other missing initializations / moved some from constructors.
2022-04-29Add GDNativeInterface::get_library_path to GDExtensionEmmanuel Leblond
2022-04-12Remove or make private `FileAccess` `close()` methods.bruvzg
2022-04-11Make FileAccess and DirAccess classes reference counted.bruvzg
2022-04-04Zero initialize all pointer class and struct membersRémi Verschelde
This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
2022-03-09Remove unused GDNative codeRémi Verschelde
This has been superseded by GDExtension so this code is no longer useful nor usable. There's still some GDNative-related stuff in platform export code which needs to be adapted for GDExtension (e.g. to include GDExtension libraries in exports).
2022-02-16Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde
Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
2022-02-14[OS/Crypto] Add get_entropy to OS.Fabio Alessandrelli
Implemented via `BCryptGenRandom` on Windows. Implemented via `getentropy` syscall when available. Implemented via `/dev/urandom` device as a fallback. The `/dev/urandom` fallback can be disabled via the `NO_URANDOM` build flag. Note: The HTML5 version relies on emscripten file system urandom device which itself uses the Crypto API when available or the plain old not crypto-safe `Math.random()` otherwise. Restore get_entropy.
2022-01-29[Net] Simplify IP resolution code, fix caching.Fabio Alessandrelli
First, we should not insert into cache if the hostname resolution has failed (as it might be a temporary internet issue), second, the async resolver should also properly insert into cache. Took the chance to remove some duplicate code with critical section in it at the cost of little performance when calling the blocking resolve_hostname function.
2022-01-17Merge pull request #56012 from bruvzg/wt🤎4Rémi Verschelde
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-18[Windows] Improve console handling and execute/create_process.bruvzg
Always build with the GUI subsystem. Redirect stdout and stderr output to the parent process console. Use CreateProcessW for blocking `execute` calls with piped stdout and stderr (prevent console windows for popping up when used with the GUI subsystem build, and have more consistent behavior with `create_process`). Add `open_console` argument to the `execute` and `create_process` to open a new console window. Remove `interface/editor/hide_console_window` editor setting. Remove `Toggle System Console` menu option. Remove `set_console_visible` and `is_console_visible` functions.
2021-12-15Add / to the unix shortcut drive listHaoyu Qiu
Also made `get_current_drive()` to pick the longest match on Unix.
2021-12-09Replace String comparisons with "", String() to is_empty()Nathan Franke
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
2021-12-01Only print message for `get_modified_time()` failure when in verbose modeHugo Locurcio
This error message was often displayed for no good reason when PCK files were loaded in the editor. Since file modification dates are secondary metadata, it's not very important if it can't be retrieved successfully anyway.
2021-11-26Fix console colors on WindowsYuri Roubinsky
2021-11-18Fix data directory of unnamed projectskobewi
2021-10-28Update Time documentationAaron Franke
2021-10-14Implement toast notifications in the editorGilles Roudière