summaryrefslogtreecommitdiffstats
path: root/drivers/unix
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #26159 from marxin/fix-Wsuggest-attribute=formatRémi Verschelde2019-02-271-1/+1
|\ | | | | Fix -Wsuggest-attribute=format warnings.
| * Fix -Wsuggest-attribute=format warnings.marxin2019-02-271-1/+1
| |
* | Fix -Wsign-compare warnings.marxin2019-02-271-1/+1
|/ | | | | I decided to modify code in a defensive way. Ideally functions like size() or length() should return an unsigned type.
* Fix typos with codespellRémi Verschelde2019-02-133-3/+3
| | | | | | | | | | | | | | | | | | | | Using codespell 1.14.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang doubleclick lod nd numer que te unselect EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* Fix OS_Unix::set_environmentIgnacio Etcheverry2019-02-041-1/+1
|
* Added set_environment to OS classIgnacio Etcheverry2019-02-032-0/+6
|
* Fix code style issuesRémi Verschelde2019-01-261-1/+0
|
* Improve custom thread numbering for POSIXIgnacio Etcheverry2019-01-251-3/+14
| | | | We lazily assign new IDs to threads that do not have one. This is the case for threads not created by the Godot API.
* Add function to obtain filesystem type from DirAccess.Juan Linietsky2019-01-212-0/+7
| | | | Change EditorFileSystem to not use directory modification times on FAT32, fixes #20946
* Update copyright statements to 2019Rémi Verschelde2019-01-0120-40/+40
| | | | Happy new year to the wonderful Godot community!
* Android: Better identify thirdparty C/C++ codeRémi Verschelde2018-12-201-3/+5
| | | | | | | | | | | | | | | | | | | - The `cpu-features.{c,h}` code was only used by chance by the webm (libvpx) code, so I moved it there. It was actually introduced before that and wasn't in use, and libvpx just happened to be able to compile thanks to it being bundled. It could potentially be compiled on the fly from the Android NDK, but since we plan to replace the webm module by a GDNative plugin in the near future, I went the bundling route. - `ifaddrs_android.h` is already provided in the Android NDK as `ifaddrs.h`, same as on other Unixes. Yet we cannot use it until we up the min API level to 24, where `getifaddrs` is first defined. I moved the files to `thirdparty/misc` and synced them with upstream WebRTC (only indentation changes and removal of `static` qualifiers). Also removes dropped thirdparty files from COPYRIGHT.txt after changes in #24105 and #24145.
* Added OS.get_system_time_msecs()volzhs2018-12-202-0/+7
|
* Moved member variables to initializer listWilson E. Alvarez2018-12-112-9/+8
|
* Attempt to avoid breaking people's workflows on the change from ↵Juan Linietsky2018-11-271-1/+1
| | | | 8ba0d513fa0068a241a25fbb6db09315fa3309cc
* Added missing path verification on Unix, closes #20762Juan Linietsky2018-11-221-0/+11
|
* Properly accept wildcard when binding IPv4 socket.Fabio Alessandrelli2018-11-181-2/+1
| | | | | Also never return null for is_ipv4 to avoid crashes due to engine bug. (better to get an error and a broken socket then seeing your game crash)
* Merge pull request #23388 from eska014/html5-stubexecRémi Verschelde2018-10-291-0/+6
|\ | | | | Add proper stubs for OS_JavaScript::execute(), get_process_id(), kill()
| * Add proper stubs for OS_JavaScript::execute(), get_process_id(), kill()Leon Krause2018-10-291-0/+6
| | | | | | | | Avoids linker warnings and errors about undefined references.
* | Server platform works on OS X tooMarcelo Fernandez2018-10-291-1/+1
|/
* Safer getcwd in DirAccessFabio Alessandrelli2018-10-071-3/+3
| | | | Fix [-Wunused-result]
* Avoid possible overflow in OS_Unix readlinkFabio Alessandrelli2018-10-071-2/+4
| | | | Also fix [-Wunused-result]
* Fix warnings in HTML5 build outside platform filesLeon Krause2018-10-061-4/+0
|
* Fix some OSX and iOS Clang warningsRémi Verschelde2018-10-041-2/+1
| | | | | | | | | | | | | | | Fixes the following XCode 9.4.1 warnings: ``` core/os/memory.cpp:175:13: warning: unused variable 's' [-Wunused-variable] drivers/coremidi/core_midi.cpp:68:14: warning: comparison between NULL and non-pointer ('MIDIEndpointRef' (aka 'unsigned int') and NULL) [-Wnull-arithmetic] drivers/gles2/rasterizer_gles2.cpp:77:24: warning: unused function '_gl_debug_print' [-Wunused-function,34] drivers/unix/thread_posix.cpp:106:12: warning: unused variable 'running_thread' [-Wunused-variable,34] modules/gdnative/nativescript/nativescript.h:371:16: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions] platform/iphone/gl_view.mm:56:14: warning: unused variable 'video_previous_volume' [-Wunused-variable,34] platform/iphone/gl_view.mm:251:12: warning: unused function 'get_first_id' [-Wunused-function,34] platform/iphone/main.m:45:15: warning: unused variable 'app' [-Wunused-variable,34] platform/osx/os_osx.mm:79:15: warning: unused function 'convertRectToBacking' [-Wunused-function] ```
* Fix warnings in Android platformRémi Verschelde2018-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | Fixes the following Clang 7 warnings: ``` platform/android/os_android.h:240:16: warning: 'OS_Android::native_video_play' hides overloaded virtual function [-Woverloaded-virtual] platform/android/os_android.h:241:15: warning: 'OS_Android::native_video_is_playing' hides overloaded virtual function [-Woverloaded-virtual] platform/android/audio_driver_opensl.cpp:104:3: warning: suggest braces around initialization of subobject [-Wmissing-braces] platform/android/audio_driver_opensl.cpp:129:10: warning: unused variable 'numOutputs' [-Wunused-variable] platform/android/audio_driver_opensl.cpp:130:11: warning: unused variable 'deviceID' [-Wunused-variable] platform/android/java_glue.cpp:795:10: warning: unused variable 'clsio' [-Wunused-variable] platform/android/java_glue.cpp:890:12: warning: unused variable 'gob' [-Wunused-variable] platform/android/java_glue.cpp:592:13: warning: unused variable 'resized' [-Wunused-variable] platform/android/java_glue.cpp:593:13: warning: unused variable 'resized_reload' [-Wunused-variable] modules/mobile_vr/mobile_vr_interface.cpp:401:8: warning: unused variable 'aspect_ratio' [-Wunused-variable] drivers/unix/dir_access_unix.cpp:394:2: warning: THIS IS BROKEN [-W#warnings] ```
* Fix OS X get_ticks_usec return value after #22424Marcelo Fernandez2018-09-301-1/+1
|
* Use monotonic clock for get_ticks_usecFabio Alessandrelli2018-09-292-9/+38
| | | | | Static _clock_start and _clock_setup function. Use clock_gettime on Unix, mach_absolute_time on Mac.
* SCons: Build thirdparty code in own env, disable warningsRémi Verschelde2018-09-281-2/+0
| | | | | Also remove unnecessary `Export('env')` in other SCsubs, Export should only be used when exporting *new* objects.
* Remove socket_helper.h after NetSocket refactorFabio Alessandrelli2018-09-283-160/+7
|
* Fix invalid comparison warnings: [-Wbool-compare] and [-Wenum-compare]Rémi Verschelde2018-09-271-1/+1
| | | | | | | | | | | | | Fixes the following GCC 5 warnings and actual bugs: ``` drivers/unix/net_socket_posix.cpp:562:28: warning: comparison between 'enum IP::Type' and 'enum NetSocket::Type' [-Wenum-compare] modules/gdscript/gdscript_function.cpp:792:26: warning: comparison of constant '17' with boolean expression is always true [-Wbool-compare] modules/gdscript/gdscript_function.cpp:792:26: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] modules/gdscript/gdscript_parser.cpp:5082:58: warning: comparison of constant '6' with boolean expression is always false [-Wbool-compare] modules/gdscript/gdscript_parser.cpp:5082:58: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] modules/mbedtls/stream_peer_mbed_tls.cpp:286:45: warning: comparison between 'enum StreamPeerTCP::Status' and 'enum StreamPeerSSL::Status' [-Wenum-compare] modules/mbedtls/stream_peer_mbed_tls.cpp:313:45: warning: comparison between 'enum StreamPeerTCP::Status' and 'enum StreamPeerSSL::Status' [-Wenum-compare] ```
* Fix Winsock UDP ECONNRESET/ENETRESET bugFabio Alessandrelli2018-09-221-0/+21
| | | | | | | | | | | | | Since Windows 2000: Calling recv/recvfrom when an ICMP reply was received from a previous send/sendto, may result in a WSAECONNRESET error. Since Windows Vista(?)/Windows Server 2008: Calling recv/recvfrom when an ICMP reply was received from a previous send/sendto, may also result in a WSAENETRESET error. Both those features are disabled by this commit using disabling SIO_UDP_CONNRESET and SIO_UDP_NETRESET on newly created UDP sockets.
* Detect POLLERR revents too in NetSocketPosix.Fabio Alessandrelli2018-09-221-0/+1
| | | | Usually indicate an RST was received by a TCP socket.
* Use select instead of WSAPoll on Windows.Fabio Alessandrelli2018-09-221-4/+51
| | | | | | | | | WSAPoll is broken by design. It was announced as the new way to introduce compatibility to posix sockets, their implementation was broken, and they decided not to fix it. You can read the full story here: https://daniel.haxx.se/blog/2012/10/10/wsapoll-is-broken/
* Properly initialize Winsock on startupFabio Alessandrelli2018-09-133-1/+21
| | | | Also fix typo in _get_last_error which caused Winsock connect to fail.
* Merge pull request #21982 from luzpaz/misc-typosRémi Verschelde2018-09-131-1/+1
|\ | | | | Misc. typos
| * Misc. typosluz.paz2018-09-121-1/+1
| | | | | | Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
* | Unify StreamPeerTCP/TCP_Server with NetSocket APIFabio Alessandrelli2018-09-125-770/+0
| |
* | Unify PacketPeerUDP using NetSocketFabio Alessandrelli2018-09-123-408/+2
| |
* | New NetSocket interface, BSD/Win implementationFabio Alessandrelli2018-09-122-0/+632
| | | | | | | | | | | | | | | | | | | | | | Unified BSD and Winsock sockets into a single implementation of a generic NetSocket interface. This is some ground work for few network improvements: - Reuse as much code as possible between Posix and Windows. - Provide a single point of implementation for exotic sdks (consoles). - Provide platform agnostic StreamPeerTCP and PacketPeerUDP in core. - Implement connect for UDP allowing for DTLS implementation.
* | ENet wrapper properly detect disconnect on pollFabio Alessandrelli2018-09-121-1/+1
| | | | | | | | | | Now PacketPeerUDP.get_available_packet_count() return -1 if the socket is in error state.
* | Properly reset socket blocking state on closeFabio Alessandrelli2018-09-121-0/+1
| |
* | Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-1219-43/+47
|/ | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Revert "Try closing gracefully before terminating process"Rémi Verschelde2018-08-272-2/+2
|
* Add print_verbose to print to stdout only in verbose modeRémi Verschelde2018-08-241-6/+1
| | | | | | Equivalent of the cumbersome: if (OS::get_singleton()->is_stdout_verbose()) print_line(msg);
* Try closing gracefully before terminating processMarcin Zawiejski2018-08-202-2/+2
| | | | | | | Use a Microsoft recommended way of process termination for the project process run from the editor. This allows loaded DLLs to receive and handle DLL_PROCESS_DETACH notification and cleanup any global state before the process actually exits.
* Revert "added get_creation_time function for gdscript"Juan Linietsky2018-08-104-38/+0
|
* Merge pull request #18914 from notwarp/masterJuan Linietsky2018-08-104-0/+38
|\ | | | | added get_creation_time function for gdscript
| * added get_creation_time function for gdscriptDaniele Giuliani2018-05-164-0/+38
| |
* | Set SO_BROADCAST socket option for UDP sockets.Fabio Alessandrelli2018-06-051-0/+7
| |
* | Merge pull request #18279 from RandomShaper/allow-naive-httpMax Hilbrunner2018-05-261-0/+1
|\ \ | |/ |/| Allow body-up-to-EOF HTTP responses
| * Allow body-up-to-EOF HTTP responsesPedro J. Estébanez2018-05-221-0/+1
| | | | | | | | | | | | Implements the same heuristic as Curl (and web browsers): if no `Content-Length`, no `Connection: keep-alive` and no chunked transfer encoding, assume th rest of the data until EOF is the body, gracefully setting the HTTP client back to the disconnected state. Theoretically, this is not compliant with HTTP 1.1, by which `keep-alive` is the default, but in practice, an explicit header is sent by servers.