fix compile on linux 6

This commit is contained in:
NishiOwO 2025-03-12 01:54:34 +09:00
parent dc8640bcad
commit 47ce2e4754
4 changed files with 32 additions and 9 deletions

View File

@ -41,7 +41,7 @@
* permission of John Bradley.
*/
#include <varargs.h>
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
@ -173,7 +173,6 @@ static float GetDpi ARG1(HTMLWidget, hw) {
look at the problem, the following pre-ANSI code should workaround
the problem." */
static int PSprintf ARG1V(char *,format, ...) {
va_dcl
va_list args;
int len;
char *s;
@ -198,9 +197,7 @@ static int PSprintf ARG1V(char *,format, ...) {
}
#else /* not BROKEN_SOLARIS_COMPILER_STDARG */
static int
PSprintf (format, va_alist)
char* format;
va_dcl
PSprintf (char* format, ...)
{
int len;
char *s;
@ -214,7 +211,7 @@ va_dcl
}
PS_string = s;
}
va_start(args);
va_start(args, format);
len = vsprintf(PS_string+PS_len, format, args);
/* this is a hack to make it work on systems were vsprintf(s,...)
* returns s, instead of the len.

View File

@ -53,6 +53,7 @@
****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "HTMLP.h"
#include "DrawingArea.h"
#include <X11/Xaw/Scrollbar.h>

View File

@ -221,6 +221,7 @@ int s;
static char *format_get = "\
GET %s HTTP/1.0\n\
Host: %s\n\
User-Agent: %s\n\
Accept: */*\n\
%s\
@ -229,6 +230,7 @@ Accept: */*\n\
static char *format_get2 = "\
GET %s?%s HTTP/1.0\n\
Host: %s\n\
User-Agent: %s\n\
Accept: */*\n\
%s\
@ -237,6 +239,7 @@ Accept: */*\n\
static char *format_post = "\
POST %s HTTP/1.0\n\
Host: %s\n\
User-Agent: %s\n\
Accept: */*\n\
Content-length: %d\n\
@ -249,6 +252,7 @@ Content-type: %s\n\
static char *format_get_crlf = "\
GET %s HTTP/1.0\r\n\
Host: %s\r\n\
User-Agent: %s\r\n\
Accept: */*\r\n\
%s\
@ -257,6 +261,7 @@ Accept: */*\r\n\
static char *format_get2_crlf = "\
GET %s?%s HTTP/1.0\r\n\
Host: %s\r\n\
User-Agent: %s\r\n\
Accept: */*\r\n\
%s\
@ -265,6 +270,7 @@ Accept: */*\r\n\
static char *format_post_crlf = "\
POST %s HTTP/1.0\r\n\
Host: %s\r\n\
User-Agent: %s\n\
Accept: */*\r\n\
Content-length: %d\r\n\
@ -405,6 +411,14 @@ int crlf;
char *query;
char *auth_info = NULL;
char *format;
char* c_host;
c_host = malloc(strlen(up->hostname) + 10); /* not a good code but should work */
if(up->port == 0){
sprintf(c_host, "%s", up->hostname);
}else{
sprintf(c_host, "%s:%d", up->hostname, up->port);
}
if (up->data_type == NULL) data_type = "application/x-www-form-urlencoded";
else data_type = up->data_type;
@ -431,11 +445,13 @@ int crlf;
strlen(up->request_data) +
strlen(extra_header) +
strlen(auth_info) +
strlen(USER_AGENT) + 1);
strlen(USER_AGENT) +
strlen(c_host) + 1);
sprintf (query,
format,
filename,
up->request_data,
c_host,
USER_AGENT,
extra_header,
auth_info);
@ -449,10 +465,12 @@ int crlf;
strlen(data_type) +
strlen(extra_header) +
strlen(auth_info) +
strlen(USER_AGENT) + 1);
strlen(USER_AGENT) +
strlen(c_host) + 1);
sprintf (query,
format,
filename,
c_host,
USER_AGENT,
strlen(up->request_data),
data_type,
@ -469,16 +487,19 @@ int crlf;
strlen(format) +
strlen(extra_header) +
strlen(auth_info) +
strlen(USER_AGENT) + 1);
strlen(USER_AGENT) +
strlen(c_host) + 1);
sprintf (query,
format,
filename,
c_host,
USER_AGENT,
extra_header,
auth_info);
}
free(auth_info);
free(c_host);
return(query);
}

View File

@ -331,7 +331,11 @@ ReapChild()
* checked into it. This gets us off the ground with SYSV. RSE@GMI
*/
#if defined(WNOHANG) && !defined(SYSV) && !defined(SVR4)
#ifdef __linux__
int st;
#else
union wait st;
#endif
do
{