Revert "gio, glib: Use G_OS_DARWIN for code that is for such environments"

This reverts commit 476e33c3f3.

We’ve decided to remove `G_OS_DARWIN` in favour of recommending people
use `__APPLE__` instead. As per the discussion on #2802 and linked
issues,
 * Adding a new define shifts the complexity from “which of these
   platform-provided defines do I use” to “which platform-provided
   defines does G_OS_DARWIN use”
 * There should ideally be no cases where a user of GLib has to use
   their own platform-specific code, since GLib should be providing
   appropriate abstractions
 * Providing a single `G_OS_DARWIN` to cover all Apple products (macOS
   and iOS) hides the complexity of what the user is actually testing:
   are they testing for the Mach kernel, the Carbon and/or Cocoa user
   space toolkits, macOS vs iOS vs tvOS, etc

Helps: #2802
This commit is contained in:
Philip Withnall
2022-11-02 10:01:09 +00:00
parent 483b6f2214
commit 7b52ccbfc4
26 changed files with 61 additions and 61 deletions

View File

@@ -160,7 +160,7 @@
#define G_CREDENTIALS_SOCKET_GET_CREDENTIALS_SUPPORTED 1
#define G_CREDENTIALS_HAS_PID 1
#elif defined(G_OS_DARWIN)
#elif defined(__APPLE__)
#include <sys/ucred.h>
#define G_CREDENTIALS_SUPPORTED 1
#define G_CREDENTIALS_USE_APPLE_XUCRED 1
@@ -182,6 +182,6 @@ void _g_credentials_set_local_peerid (GCredentials *credentials,
#define G_CREDENTIALS_SOCKET_GET_CREDENTIALS_SUPPORTED 1
#define G_CREDENTIALS_HAS_PID 1
#endif /* defined(G_OS_DARWIN) */
#endif
#endif /* __G_CREDENTIALS_PRIVATE_H__ */