touched up code for old sco compiler
This commit is contained in:
		| @ -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.  | ||||
| 		 */ | ||||
| 		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); | ||||
| 		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) | ||||
| { | ||||
| #if defined(HAVE_GETRLIMIT) | ||||
| 	struct rlimit rlim; | ||||
| 	int fd; | ||||
| #endif | ||||
| 	int fd = -1; | ||||
| 	QSE_DIR* d; | ||||
|  | ||||
| #if defined(F_MAXFD) | ||||
| @ -473,6 +475,7 @@ static int get_highest_fd (void) | ||||
| 		return maxfd; | ||||
| 	} | ||||
|  | ||||
| #if defined(HAVE_GETRLIMIT) | ||||
| 	if (QSE_GETRLIMIT (RLIMIT_NOFILE, &rlim) <= -1 || | ||||
| 	    rlim.rlim_max == RLIM_INFINITY)  | ||||
| 	{ | ||||
| @ -481,6 +484,9 @@ static int get_highest_fd (void) | ||||
| 	#endif | ||||
| 	} | ||||
| 	else fd = rlim.rlim_max; | ||||
| #elif defined(HAVE_SYSCONF) | ||||
| 	fd = sysconf (_SC_OPEN_MAX); | ||||
| #endif | ||||
| 	if (fd <= -1) fd = 1024; /* fallback */ | ||||
|  | ||||
| 	/* F_MAXFD is the highest fd. but RLIMIT_NOFILE and  | ||||
| @ -488,6 +494,7 @@ static int get_highest_fd (void) | ||||
| 	 * descriptors. make adjustment */ | ||||
| 	if (fd > 0) 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_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, | ||||
| @ -667,14 +674,14 @@ int qse_pio_init ( | ||||
| 		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  | ||||
| 	}; | ||||
| 	}*/; | ||||
|  | ||||
| 	int i, minidx = -1, maxidx = -1; | ||||
|  | ||||
| @ -741,6 +748,17 @@ int qse_pio_init ( | ||||
| 	pio->mmgr = mmgr; | ||||
| 	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) | ||||
| 	/* 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  | ||||
| 			 * in case it is reallocated */ | ||||
| 			pair_t tmp = *x_cur;	  | ||||
| 			pair_t tmp; | ||||
|  | ||||
| 			tmp = *x_cur;	  | ||||
|  | ||||
| 			/* call the callback function to manipulate the pair */ | ||||
| 			x_new = cbserter (rbt, x_cur, kptr, klen, ctx); | ||||
|  | ||||
| @ -895,7 +895,7 @@ static qse_rex_node_t* comp_atom (comp_t* com) | ||||
| 			default: | ||||
| 				if (com->rex->option & QSE_REX_STRICT) | ||||
| 				{ | ||||
| 					qse_char_t spc[] = | ||||
| 					static qse_char_t spc[] = | ||||
|         				{ | ||||
| 						QSE_T(')'), | ||||
| 						QSE_T('?'), | ||||
| @ -905,10 +905,20 @@ static qse_rex_node_t* comp_atom (comp_t* com) | ||||
| 						QSE_T('\0') | ||||
| 					}; | ||||
|  | ||||
| 					if (com->rex->option & QSE_REX_NOBOUND) | ||||
| 						spc[4] = QSE_T('\0'); | ||||
| 					static qse_char_t nobound_spc[] = | ||||
|         				{ | ||||
| 						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; | ||||
| 						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  | ||||
| 	 * handling on windows. 2 is the maximum for DBCS encodings. */ | ||||
| 	return 2;  | ||||
| #else | ||||
|  | ||||
| #elif defined(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 | ||||
| } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user