Defining __USE_XOPEN_EXTENDED was the wrong thing. Instead, define
[openssl.git] / crypto / ui / ui_lib.c
index c5d17042f9f9f3faebc8f8cfb7bd730a25c9c70f..f55a79c740c7b29bcb9cf5ff9095ac952d7bdf16 100644 (file)
@@ -63,7 +63,8 @@
 # define _XOPEN_SOURCE_EXTENDED
 #endif
 #ifdef OPENSSL_SYS_UNIX
 # define _XOPEN_SOURCE_EXTENDED
 #endif
 #ifdef OPENSSL_SYS_UNIX
-# define __USE_XOPEN_EXTENDED  /* For Linux and probably anything GNU */
+# define _XOPEN_SOURCE
+# define _XOPEN_SOURCE_EXTENDED        /* For Linux and probably anything GNU */
 #endif
 #include <string.h>
 
 #endif
 #include <string.h>
 
@@ -256,6 +257,18 @@ int UI_dup_error_string(UI *ui, const char *text)
                NULL);
        }
 
                NULL);
        }
 
+void *UI_add_user_data(UI *ui, void *user_data)
+       {
+       void *old_data = ui->user_data;
+       ui->user_data = user_data;
+       return old_data;
+       }
+
+void *UI_get0_user_data(UI *ui)
+       {
+       return ui->user_data;
+       }
+
 const char *UI_get0_result(UI *ui, int i)
        {
        if (i < 0)
 const char *UI_get0_result(UI *ui, int i)
        {
        if (i < 0)