source: trunk/dports/gnome/gdm/files/patch-daemon-gdm-session-worker.c.diff @ 114879

Last change on this file since 114879 was 114879, checked in by devans@…, 6 years ago

gdm: revised build fix for SL and earlier.

File size: 960 bytes
  • daemon/gdm-session-worker.c

    old new  
    740740        return utf8;
    741741}
    742742
     743#ifdef __APPLE__
     744#include <Availability.h>
     745#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1060
     746static char * strndup (char const *s, size_t n);
     747static size_t strnlen (const char *string, size_t maxlen);
     748
     749static size_t
     750strnlen (const char *string, size_t maxlen)
     751{
     752  const char *end = memchr (string, '\0', maxlen);
     753  return end ? (size_t) (end - string) : maxlen;
     754}
     755
     756static char *
     757strndup (char const *s, size_t n)
     758{
     759  size_t len = strnlen (s, n);
     760  char *new = malloc (len + 1);
     761
     762  if (new == NULL)
     763    return NULL;
     764
     765  new[len] = '\0';
     766  return memcpy (new, s, len);
     767}
     768#endif
     769#endif
    743770static gboolean
    744771gdm_session_worker_process_pam_message (GdmSessionWorker          *worker,
    745772                                        const struct pam_message  *query,
Note: See TracBrowser for help on using the repository browser.