touched up code for old sco compiler
This commit is contained in:
		| @ -158,6 +158,14 @@ available for the native makefile for Watcom C/C++ for OS/2 only. | |||||||
|  |  | ||||||
| ### SCO UNIX System V/386 Release 3.2 ### | ### SCO UNIX System V/386 Release 3.2 ### | ||||||
|  |  | ||||||
|  | - If /usr/include/netinet and /usr/include/net are missing, | ||||||
|  |   check if there are /usr/include/sys/netinet and /usr/include/sys/net. | ||||||
|  |   f they exists, you can make these symbolic links. | ||||||
|  |  | ||||||
|  |     cd /usr/include | ||||||
|  |     ln -sf sys/netinet netinet | ||||||
|  |     ln -sf sys/net net | ||||||
|  |  | ||||||
| - Specify GREP if configure fails to find an acceptable grep. | - Specify GREP if configure fails to find an acceptable grep. | ||||||
| - Build in the source tree. Building outside the source tree is likely to fail | - Build in the source tree. Building outside the source tree is likely to fail | ||||||
|   for dificiency of the bundled make utility. |   for dificiency of the bundled make utility. | ||||||
| @ -165,6 +173,9 @@ available for the native makefile for Watcom C/C++ for OS/2 only. | |||||||
|  |  | ||||||
|     ./configure GREP=/bin/grep CFLAGS="" |     ./configure GREP=/bin/grep CFLAGS="" | ||||||
|  |  | ||||||
|  | - Change RANLIB from "ranlib" to "true" in libltdl/libtool. | ||||||
|  |  | ||||||
|  |     make | ||||||
|  |  | ||||||
| ### More options ### | ### More options ### | ||||||
|  |  | ||||||
|  | |||||||
| @ -627,7 +627,10 @@ static int get_nwifcfg (int s, qse_nwifcfg_t* cfg, struct ifreq* ifr) | |||||||
| 		 * use the streams interface to get the hardware address.  | 		 * use the streams interface to get the hardware address.  | ||||||
| 		 */ | 		 */ | ||||||
| 		int strfd; | 		int strfd; | ||||||
| 		qse_mchar_t devname[QSE_COUNTOF(ifr->ifr_name) + 5 + 1] = QSE_MT("/dev/"); | 		/*qse_mchar_t devname[QSE_COUNTOF(ifr->ifr_name) + 5 + 1] = QSE_MT("/dev/");*/ | ||||||
|  | 		qse_mchar_t devname[QSE_COUNTOF(ifr->ifr_name) + 5 + 1]; | ||||||
|  |  | ||||||
|  | 		qse_mbscpy (devname, QSE_MT("/dev/")); | ||||||
| 		qse_mbscpy (&devname[5], ifr->ifr_name); | 		qse_mbscpy (&devname[5], ifr->ifr_name); | ||||||
| 		if ((strfd = QSE_OPEN (devname, O_RDONLY, 0)) >= 0) | 		if ((strfd = QSE_OPEN (devname, O_RDONLY, 0)) >= 0) | ||||||
| 		{ | 		{ | ||||||
|  | |||||||
| @ -425,8 +425,10 @@ static int close_unneeded_fds_using_proc (int* excepts, qse_size_t count) | |||||||
|  |  | ||||||
| static int get_highest_fd (void) | static int get_highest_fd (void) | ||||||
| { | { | ||||||
|  | #if defined(HAVE_GETRLIMIT) | ||||||
| 	struct rlimit rlim; | 	struct rlimit rlim; | ||||||
| 	int fd; | #endif | ||||||
|  | 	int fd = -1; | ||||||
| 	QSE_DIR* d; | 	QSE_DIR* d; | ||||||
|  |  | ||||||
| #if defined(F_MAXFD) | #if defined(F_MAXFD) | ||||||
| @ -473,6 +475,7 @@ static int get_highest_fd (void) | |||||||
| 		return maxfd; | 		return maxfd; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | #if defined(HAVE_GETRLIMIT) | ||||||
| 	if (QSE_GETRLIMIT (RLIMIT_NOFILE, &rlim) <= -1 || | 	if (QSE_GETRLIMIT (RLIMIT_NOFILE, &rlim) <= -1 || | ||||||
| 	    rlim.rlim_max == RLIM_INFINITY)  | 	    rlim.rlim_max == RLIM_INFINITY)  | ||||||
| 	{ | 	{ | ||||||
| @ -481,6 +484,9 @@ static int get_highest_fd (void) | |||||||
| 	#endif | 	#endif | ||||||
| 	} | 	} | ||||||
| 	else fd = rlim.rlim_max; | 	else fd = rlim.rlim_max; | ||||||
|  | #elif defined(HAVE_SYSCONF) | ||||||
|  | 	fd = sysconf (_SC_OPEN_MAX); | ||||||
|  | #endif | ||||||
| 	if (fd <= -1) fd = 1024; /* fallback */ | 	if (fd <= -1) fd = 1024; /* fallback */ | ||||||
|  |  | ||||||
| 	/* F_MAXFD is the highest fd. but RLIMIT_NOFILE and  | 	/* F_MAXFD is the highest fd. but RLIMIT_NOFILE and  | ||||||
| @ -488,6 +494,7 @@ static int get_highest_fd (void) | |||||||
| 	 * descriptors. make adjustment */ | 	 * descriptors. make adjustment */ | ||||||
| 	if (fd > 0) fd--;  | 	if (fd > 0) fd--;  | ||||||
|  |  | ||||||
|  |  | ||||||
| 	return fd; | 	return fd; | ||||||
| } | } | ||||||
|  |  | ||||||
| @ -659,7 +666,7 @@ int qse_pio_init ( | |||||||
| 	qse_pio_t* pio, qse_mmgr_t* mmgr, const qse_char_t* cmd,  | 	qse_pio_t* pio, qse_mmgr_t* mmgr, const qse_char_t* cmd,  | ||||||
| 	qse_env_t* env, int flags) | 	qse_env_t* env, int flags) | ||||||
| { | { | ||||||
| 	qse_pio_hnd_t handle[6] =  | 	qse_pio_hnd_t handle[6] /*=  | ||||||
| 	{  | 	{  | ||||||
| 		QSE_PIO_HND_NIL,  | 		QSE_PIO_HND_NIL,  | ||||||
| 		QSE_PIO_HND_NIL, | 		QSE_PIO_HND_NIL, | ||||||
| @ -667,14 +674,14 @@ int qse_pio_init ( | |||||||
| 		QSE_PIO_HND_NIL, | 		QSE_PIO_HND_NIL, | ||||||
| 		QSE_PIO_HND_NIL, | 		QSE_PIO_HND_NIL, | ||||||
| 		QSE_PIO_HND_NIL | 		QSE_PIO_HND_NIL | ||||||
| 	}; | 	}*/; | ||||||
|  |  | ||||||
| 	qse_tio_t* tio[3] =  | 	qse_tio_t* tio[3] /*=  | ||||||
| 	{  | 	{  | ||||||
| 		QSE_NULL,  | 		QSE_NULL,  | ||||||
| 		QSE_NULL,  | 		QSE_NULL,  | ||||||
| 		QSE_NULL  | 		QSE_NULL  | ||||||
| 	}; | 	}*/; | ||||||
|  |  | ||||||
| 	int i, minidx = -1, maxidx = -1; | 	int i, minidx = -1, maxidx = -1; | ||||||
|  |  | ||||||
| @ -741,6 +748,17 @@ int qse_pio_init ( | |||||||
| 	pio->mmgr = mmgr; | 	pio->mmgr = mmgr; | ||||||
| 	pio->flags = flags; | 	pio->flags = flags; | ||||||
|  |  | ||||||
|  | 	handle[0] = QSE_PIO_HND_NIL; | ||||||
|  | 	handle[1] = QSE_PIO_HND_NIL; | ||||||
|  | 	handle[2] = QSE_PIO_HND_NIL; | ||||||
|  | 	handle[3] = QSE_PIO_HND_NIL; | ||||||
|  | 	handle[4] = QSE_PIO_HND_NIL; | ||||||
|  | 	handle[5] = QSE_PIO_HND_NIL; | ||||||
|  |  | ||||||
|  | 	tio[0] = QSE_NULL; | ||||||
|  | 	tio[1] = QSE_NULL; | ||||||
|  | 	tio[2] = QSE_NULL; | ||||||
|  |  | ||||||
| #if defined(_WIN32) | #if defined(_WIN32) | ||||||
| 	/* http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx */ | 	/* http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx */ | ||||||
|  |  | ||||||
|  | |||||||
| @ -612,7 +612,9 @@ pair_t* qse_rbt_cbsert ( | |||||||
| 		{ | 		{ | ||||||
| 			/* back up the contents of the current pair  | 			/* back up the contents of the current pair  | ||||||
| 			 * in case it is reallocated */ | 			 * in case it is reallocated */ | ||||||
| 			pair_t tmp = *x_cur;	  | 			pair_t tmp; | ||||||
|  |  | ||||||
|  | 			tmp = *x_cur;	  | ||||||
|  |  | ||||||
| 			/* call the callback function to manipulate the pair */ | 			/* call the callback function to manipulate the pair */ | ||||||
| 			x_new = cbserter (rbt, x_cur, kptr, klen, ctx); | 			x_new = cbserter (rbt, x_cur, kptr, klen, ctx); | ||||||
|  | |||||||
| @ -895,7 +895,7 @@ static qse_rex_node_t* comp_atom (comp_t* com) | |||||||
| 			default: | 			default: | ||||||
| 				if (com->rex->option & QSE_REX_STRICT) | 				if (com->rex->option & QSE_REX_STRICT) | ||||||
| 				{ | 				{ | ||||||
| 					qse_char_t spc[] = | 					static qse_char_t spc[] = | ||||||
|         				{ |         				{ | ||||||
| 						QSE_T(')'), | 						QSE_T(')'), | ||||||
| 						QSE_T('?'), | 						QSE_T('?'), | ||||||
| @ -905,10 +905,20 @@ static qse_rex_node_t* comp_atom (comp_t* com) | |||||||
| 						QSE_T('\0') | 						QSE_T('\0') | ||||||
| 					}; | 					}; | ||||||
|  |  | ||||||
| 					if (com->rex->option & QSE_REX_NOBOUND) | 					static qse_char_t nobound_spc[] = | ||||||
| 						spc[4] = QSE_T('\0'); |         				{ | ||||||
|  | 						QSE_T(')'), | ||||||
|  | 						QSE_T('?'), | ||||||
|  | 						QSE_T('*'), | ||||||
|  | 						QSE_T('+'), | ||||||
|  | 						QSE_T('\0') | ||||||
|  | 					}; | ||||||
|  |  | ||||||
| 					if (qse_strchr (spc, com->c.value) != QSE_NULL) | 					const qse_char_t* ptr; | ||||||
|  |  | ||||||
|  | 					ptr = (com->rex->option & QSE_REX_NOBOUND)? nobound_spc: spc; | ||||||
|  |  | ||||||
|  | 					if (qse_strchr (ptr, com->c.value)) | ||||||
| 					{ | 					{ | ||||||
| 						com->rex->errnum = QSE_REX_ESPCAWP; | 						com->rex->errnum = QSE_REX_ESPCAWP; | ||||||
| 						return QSE_NULL; | 						return QSE_NULL; | ||||||
|  | |||||||
| @ -293,8 +293,19 @@ qse_size_t qse_slmblenmax (void) | |||||||
| 	 * is CP_UTF8(65001). you should use functions in utf8.c for utf8  | 	 * is CP_UTF8(65001). you should use functions in utf8.c for utf8  | ||||||
| 	 * handling on windows. 2 is the maximum for DBCS encodings. */ | 	 * handling on windows. 2 is the maximum for DBCS encodings. */ | ||||||
| 	return 2;  | 	return 2;  | ||||||
| #else |  | ||||||
|  | #elif defined(MB_CUR_MAX) | ||||||
|  |  | ||||||
| 	return MB_CUR_MAX; | 	return MB_CUR_MAX; | ||||||
|  |  | ||||||
|  | #elif (QSE_SIZEOF_WCHAR_T == QSE_SIZEOF_MCHAR_T) | ||||||
|  |  | ||||||
|  | 	/* no proper multibyte string support */ | ||||||
|  | 	return 1;	 | ||||||
|  |  | ||||||
|  | #else | ||||||
|  | 	/* fallback max utf8 value */ | ||||||
|  | 	return 6; | ||||||
| #endif | #endif | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user