From d3b8aa3734656c589fb6f6555ce21fbc77bbfc88 Mon Sep 17 00:00:00 2001 From: "Dr. Michael Lauer" Date: Tue, 6 Mar 2018 16:29:25 +0100 Subject: [PATCH] posix: Fix crypt(3), now that we have feature test macros. Note that crypt(3) returns 'null' on error. --- vapi/posix.vapi | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/vapi/posix.vapi b/vapi/posix.vapi index 155e70429..5265ab52d 100644 --- a/vapi/posix.vapi +++ b/vapi/posix.vapi @@ -2126,16 +2126,8 @@ namespace Posix { [Version (deprecated_since = "POSIX.2", replacement = "termios ECHO flag")] [CCode (cheader_filename = "unistd.h")] public unowned string getpass (string promt); - /** - * Encodes a string - * - * To expose Posix crypt() GNU's libc and others require the feature test - * macro _XOPEN_SOURCE to be defined. See man 3 crypt. - * A VAPI is unable to define and emit this macro before all include files - * Instead use valac -X -D_XOPEN_SOURCE - */ - [CCode (cheader_filename = "unistd.h")] - public unowned string crypt (string key, string salt); + [CCode (cheader_filename = "unistd.h", feature_test_macro = "_XOPEN_SOURCE")] + public unowned string? crypt (string key, string salt); [CCode (cheader_filename = "unistd.h")] public int getpagesize (); [CCode (cheader_filename = "unistd.h")] -- 2.11.4.GIT