Commit graph

208 commits

Author SHA1 Message Date
rfm
6667842dd5 Update FSF address as requested by Gregory 2024-11-07 13:37:59 +00:00
Hugo Melder
7474bd80e3
Add Branch Prediction Macros and Error checks in Android Initialisation (#438)
* Add Branch Prediction Macros

* Rigorous Error Handling when using JNI
2024-08-20 19:19:59 +02:00
Hugo Melder
81b3c721bc
NSUserDefaults: Retrieve native UI languages from Windows and Android System APIs (#426)
* Create NSString Win32Additions Category

* NSUserDefaults: Fetch Windows UI language information

* NSUserDefaults: Add winnls include

* Android Native UI Language

* NSUserDefaults: Replace incorrect separator on Windows

* NSProcessInfo: BCP-47 Note

* GSConfig: Bump MinGW WINVER to Vista

* NSString+Win32Additions: Do not add array to arp twice

* NSUserDefaults: Increase default length
2024-08-07 16:26:16 +02:00
Frederik Seiffert
6d1fe8fadf Initialize Android process with current locale and system time zone 2024-02-11 09:04:04 +01:00
Richard Frith-Macdonald
0b1a2d4d66 Tidy positioning of semicolon to be inside IF_NO_ARC() macros so it won't appear in the source when compiled with ARC 2022-02-17 10:21:36 +00:00
Richard Frith-Macdonald
c76ebf2962 Replaced IF_NO_GC() macro calls with the more descriptive IF_NO_ARC()
and deprecate it.  Searched for and removed obsolete references to
garbage collection in comments and documentation.
2022-02-17 10:08:18 +00:00
Frederik Seiffert
f67c99dbcc win32: initialize Windows Sockets in NSObject only
And update to Windows Socket version 2.2. Also clean up the DllMain initialization to handle CRT init errors and call _CRT_INIT also on DLL/thread detach, and remove uneeded .idata section after removing WSAStartup() import.

WSAStartup() should not be called from DllMain according to MS documentation. Fixes #186.
2021-08-11 19:32:21 +02:00
Frederik Seiffert
acde7b062a Fix release method signature to match NSObject 2021-08-11 19:32:21 +02:00
Frederik Seiffert
27c06a9209 Fix various incorrect format string types 2021-08-11 19:32:21 +02:00
Frederik Seiffert
5fb5fb46c4 Win MSVC: add NSFileManager support
Also unifies _CHAR in NSFileManager with GSNativeChar, as they are internally required to be the same.
2021-03-17 17:42:15 +01:00
Frederik Seiffert
3752016412 Improve NSLog output on Android. 2020-07-08 16:15:57 +02:00
Gregory John Casamento
753c907938 Fix address for FSF and License name in all headers in base 2019-12-09 18:36:00 -05:00
Frederik Seiffert
a9641e6818 Added support for temp and caches dir on Android. 2019-11-15 09:04:58 +01:00
Frederik Seiffert
d23c5013bf Added support for data directory on Android.
This makes GNUstep use the path returned by Context.getFilesDir() as the basis for storing data (e.g. NSUserDefaults) and when querying system directory paths (NSLibraryDirectory, NSApplicationSupportDirectory, etc.). Requires calling a new GSInitializeProcessAndroid() initialization function.
2019-09-25 12:11:50 +02:00
Richard Frith-Macdonald
2425c42ace Cosmetic tweaks to match coding style 2019-06-06 14:16:30 +01:00
Frederik Seiffert
3b60b1a8be Added support for asset loading on Android.
Requires passing the activity's AssetManager object from Java to GNUstep by calling +[NSBundle setJavaAssetManager:withJNIEnv:], which then enables the following features:

- NSBundle main bundle resource paths support for Android assets, e.g. for pathForResource:ofType:, URLForResource:ofType: and related methods.
- NSBundle main bundle info dictionary support if Info.plist exists in Android assets.
- -initWithContentsOfFile: and related methods support for reading Android assets from main bundle in various classes (e.g. NSData, NSDictionary, NSArray, etc.).
- NSFileManager fileExistsAtPath:(isDirectory:) and isReadableFileAtPath: return YES for main bundle asset / asset directory paths.
- NSFileHandle support for reading Android assets from main bundle.
- NSDirectoryEnumerator support for enumerating Android assets from main bundle. Note that recursion into subdirectories is currently not supported by the native Android asset manager API (see https://issuetracker.google.com/issues/37002833).

Also adds support for automatic NSProcessInfo initialization on Android with a fake executable path "/data/data/<app identifier>/exe" (as Android apps don't have a real executable path), and tweaks main bundle initialization to allow that path. Main bundle resource paths are prefixed by "/data/data/<app identifier>/Resources".
2019-05-23 15:44:07 +02:00
Riccardo
6b455a589d Fix GetTickCount()/GetTickCount64() for different Windows versions 2017-07-07 10:50:10 +02:00
Daniel Ferreira
d49db3ab29 NSProcessInfo: add stubs for new APIs
Add stubs for sudden termination APIs and for application activity
management methods.
2017-06-29 21:18:16 +01:00
Daniel Ferreira
cbfa4d8cc9 NSProcessInfo: implement getting system uptime
Introduce the systemUptime property to NSProcessInfo, which can compute
platform-independently what is the uptime of the system.
2017-06-29 21:18:16 +01:00
Richard Frith-MacDonald
0d0b2b4503 avoid spurious compiler warning
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39674 72102866-910b-0410-8b05-ffd578937521
2016-04-17 15:18:43 +00:00
Richard Frith-MacDonald
62d2bcbabc changes for use of _WIN32 define on windows
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39492 72102866-910b-0410-8b05-ffd578937521
2016-03-09 13:16:16 +00:00
Richard Frith-MacDonald
d4c719b42f safer error logging when we can't initialise process info
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39375 72102866-910b-0410-8b05-ffd578937521
2016-02-15 12:13:37 +00:00
Richard Frith-MacDonald
1400bcefcf bugfix release
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38120 72102866-910b-0410-8b05-ffd578937521
2014-10-17 13:42:34 +00:00
Richard Frith-MacDonald
371454f0c3 Fixup host name
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37804 72102866-910b-0410-8b05-ffd578937521
2014-04-19 01:34:48 +00:00
Richard Frith-MacDonald
6829d65f68 use localizedName
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37802 72102866-910b-0410-8b05-ffd578937521
2014-04-18 20:18:35 +00:00
Richard Frith-MacDonald
974fa5d811 handle invalidation of connection while getting root proxy
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37768 72102866-910b-0410-8b05-ffd578937521
2014-03-26 07:56:09 +00:00
Riccardo Mottola
f5326c8db1 uname() on solaris may return a positive value on success, not just 0
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37767 72102866-910b-0410-8b05-ffd578937521
2014-03-25 23:06:00 +00:00
Richard Frith-MacDonald
ed09c55959 leak detection improvements
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37003 72102866-910b-0410-8b05-ffd578937521
2013-08-22 15:44:54 +00:00
Richard Frith-MacDonald
e1271866b4 More tweaks to avoid warnings (minor memory leak fixed in HTMLLinker.m)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36535 72102866-910b-0410-8b05-ffd578937521
2013-04-15 06:04:40 +00:00
Richard Frith-MacDonald
f371df09b6 more static analyser fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36532 72102866-910b-0410-8b05-ffd578937521
2013-04-14 18:49:23 +00:00
Richard Frith-MacDonald
54ff9b7de5 static analyzer tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36523 72102866-910b-0410-8b05-ffd578937521
2013-04-14 09:04:40 +00:00
Richard Frith-MacDonald
0be505308d simplification, including use of strtoull() everywhere
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35503 72102866-910b-0410-8b05-ffd578937521
2012-09-03 13:36:45 +00:00
Richard Frith-MacDonald
4386a7eda9 add missing cast on mingw
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34399 72102866-910b-0410-8b05-ffd578937521
2012-01-03 10:31:41 +00:00
Richard Frith-MacDonald
f7b8b22bae trivial formating tweaks ... add missing white space
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34374 72102866-910b-0410-8b05-ffd578937521
2012-01-01 07:38:53 +00:00
Richard Frith-MacDonald
32fc733268 changes to support alternative header locations
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34290 72102866-910b-0410-8b05-ffd578937521
2011-12-15 09:42:39 +00:00
Fred Kiefer
eee46e56de * Source/NSProcessInfo.m: Add includes needed for the HAVE_PROCFS
case.
* Source/common.h: Correct last commit, the #endif was placed
incorrectly.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34041 72102866-910b-0410-8b05-ffd578937521
2011-10-22 13:59:05 +00:00
Richard Frith-MacDonald
8f44e1d6f0 include errno for strerror
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33997 72102866-910b-0410-8b05-ffd578937521
2011-10-14 17:53:46 +00:00
Richard Frith-MacDonald
eb8b275c1f internal workaround for clang namespace pollution.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33993 72102866-910b-0410-8b05-ffd578937521
2011-10-14 15:46:13 +00:00
Richard Frith-MacDonald
fbdcab1d55 solaris thread-saff errrno fix
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33983 72102866-910b-0410-8b05-ffd578937521
2011-10-14 11:40:34 +00:00
David Chisnall
d2ea054c26 Lots of little fixes to make -base compile with -Werror (now builds without warnings).
Richard: I'm unsure about three of these, which were fixes in memset() calls in:
- NSConcreteMapTable.m
- NSConcreteHashTable.m
- Additions/NSData+GNUstepBase.m

Please can you check them?  I think they are intended to zero the entire object
(rather than the first word), but the lack of comments makes me unsure.

Most changes were just tweaks to variable types.  I've also removed some dead code from NSInvocation.  This was small group of things that were marked for internal use only, but not actually referenced in the code anywhere.

Other improvements:

- NSArray / NSDictionary fixed up to use the 10.7 (ARC-friendly) prototypes.
- getObjects:andKeys: implemented for NSDictionary (10.5 method)
- NSPointerArray and NSHashTable now properly support weak objects.
- Tests for weak objects in collections.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33621 72102866-910b-0410-8b05-ffd578937521
2011-07-24 13:09:22 +00:00
David Chisnall
7764740bdc Make -drain and -release in NSAutoreleasePool do the same thing (rather than one calling the other) in non-GC mode.
Replace all -release messages sent to autorelease pools with -drain.  In non-GC mode, these are equivalent.  In GC mode, these trigger a collection.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33143 72102866-910b-0410-8b05-ffd578937521
2011-05-27 11:48:44 +00:00
Wolfgang Lux
a4bda067a6 Disable use of a fake main function by default on Darwin/Mac OS X.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32638 72102866-910b-0410-8b05-ffd578937521
2011-03-17 22:33:31 +00:00
Richard Frith-MacDonald
218582e63c more bsd tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32485 72102866-910b-0410-8b05-ffd578937521
2011-03-07 15:34:06 +00:00
Richard Frith-MacDonald
96e48988fc avoid compiler/linker warnings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32483 72102866-910b-0410-8b05-ffd578937521
2011-03-07 11:34:17 +00:00
Richard Frith-MacDonald
d18e29dde8 avoid compiler warnings
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32417 72102866-910b-0410-8b05-ffd578937521
2011-02-28 19:49:57 +00:00
Richard Frith-MacDonald
474a12b708 minor cleanups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32234 72102866-910b-0410-8b05-ffd578937521
2011-02-19 19:42:42 +00:00
Richard Frith-MacDonald
27550994ee use the _() macro for localisation within base
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32173 72102866-910b-0410-8b05-ffd578937521
2011-02-15 06:25:54 +00:00
Richard Frith-MacDonald
b6f476a7eb Cleanups plus minor OSX compatibility tweak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31781 72102866-910b-0410-8b05-ffd578937521
2010-12-27 07:03:50 +00:00
Richard Frith-MacDonald
2436a98ae9 improve comments
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30636 72102866-910b-0410-8b05-ffd578937521
2010-06-09 15:19:01 +00:00
Richard Frith-MacDonald
d2a49f16a8 Fixes for bug #29845 and mime parsing improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30635 72102866-910b-0410-8b05-ffd578937521
2010-06-09 15:03:37 +00:00