Pass CFLAG to dependency makers, so non-standard system include paths are
[openssl.git] / crypto / err / err.c
index c909c3f4dcf43144368e815a03bf23dbbaf74677..5abe44e6d57d7b63cf6475a3ef275c93eb080db6 100644 (file)
@@ -166,6 +166,7 @@ static ERR_STRING_DATA ERR_str_functs[]=
        {ERR_PACK(0,SYS_F_WSASTARTUP,0),        "WSAstartup"},
 #endif
        {ERR_PACK(0,SYS_F_OPENDIR,0),           "opendir"},
+       {ERR_PACK(0,SYS_F_FREAD,0),             "fread"},
        {0,NULL},
        };
 
@@ -676,26 +677,29 @@ unsigned long ERR_get_error_line_data(const char **file, int *line,
             const char **data, int *flags)
        { return(get_error_values(1,0,file,line,data,flags)); }
 
+
 unsigned long ERR_peek_error(void)
        { return(get_error_values(0,0,NULL,NULL,NULL,NULL)); }
 
-unsigned long ERR_peek_last_error(void)
-       { return(get_error_values(0,1,NULL,NULL,NULL,NULL)); }
-
 unsigned long ERR_peek_error_line(const char **file, int *line)
        { return(get_error_values(0,0,file,line,NULL,NULL)); }
 
-unsigned long ERR_peek_last_error_line(const char **file, int *line)
-       { return(get_error_values(0,1,file,line,NULL,NULL)); }
-
 unsigned long ERR_peek_error_line_data(const char **file, int *line,
             const char **data, int *flags)
        { return(get_error_values(0,0,file,line,data,flags)); }
 
+
+unsigned long ERR_peek_last_error(void)
+       { return(get_error_values(0,1,NULL,NULL,NULL,NULL)); }
+
+unsigned long ERR_peek_last_error_line(const char **file, int *line)
+       { return(get_error_values(0,1,file,line,NULL,NULL)); }
+
 unsigned long ERR_peek_last_error_line_data(const char **file, int *line,
             const char **data, int *flags)
        { return(get_error_values(0,1,file,line,data,flags)); }
 
+
 static unsigned long get_error_values(int inc, int top, const char **file, int *line,
             const char **data, int *flags)
        {       
@@ -717,7 +721,7 @@ static unsigned long get_error_values(int inc, int top, const char **file, int *
 
        if (es->bottom == es->top) return 0;
        if (top)
-               i=(es->bottom+1)%ERR_NUM_ERRORS; /* last error */
+               i=es->top;                       /* last error */
        else
                i=(es->bottom+1)%ERR_NUM_ERRORS; /* first error */