]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
posix: Fix crypt(3), now that we have feature test macros.
authorDr. Michael Lauer <mickey@vanille-media.de>
Tue, 6 Mar 2018 15:29:25 +0000 (16:29 +0100)
committerDr. Michael Lauer <mickey@vanille-media.de>
Tue, 6 Mar 2018 15:32:29 +0000 (16:32 +0100)
Note that crypt(3) returns 'null' on error.

vapi/posix.vapi

index 155e704296ac8fe3ff7030a20a3a5e0845ceb207..5265ab52d3518c8c96b5f5824ddbc91fdf31502d 100644 (file)
@@ -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")]