fixed code a bit more for the old sco compiler

This commit is contained in:
hyung-hwan 2014-11-17 15:57:00 +00:00
parent e57c9673d1
commit cce68401e2
9 changed files with 38 additions and 18 deletions

View File

@ -51,7 +51,7 @@ POST_UNINSTALL = :
build_triplet = @build@ build_triplet = @build@
host_triplet = @host@ host_triplet = @host@
subdir = . subdir = .
DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/README.in \ $(srcdir)/Makefile.in $(srcdir)/README.in \
$(top_srcdir)/configure ac/config.guess ac/config.sub \ $(top_srcdir)/configure ac/config.guess ac/config.sub \
ac/depcomp ac/install-sh ac/ltmain.sh ac/missing ac/depcomp ac/install-sh ac/ltmain.sh ac/missing

2
qse/configure vendored
View File

@ -17451,7 +17451,7 @@ fi
done done
for ac_header in sys/sysctl.h sys/socket.h sys/sockio.h ifaddrs.h linux/netfilter_ipv4.h netinet/sctp.h for ac_header in sys/sysctl.h sys/socket.h sys/sockio.h sys/un.h ifaddrs.h linux/netfilter_ipv4.h netinet/sctp.h
do : do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"

View File

@ -123,7 +123,7 @@ AC_CHECK_HEADERS([stddef.h wchar.h wctype.h errno.h signal.h fcntl.h dirent.h])
AC_CHECK_HEADERS([time.h sys/time.h utime.h spawn.h execinfo.h ucontext.h]) AC_CHECK_HEADERS([time.h sys/time.h utime.h spawn.h execinfo.h ucontext.h])
AC_CHECK_HEADERS([sys/resource.h sys/wait.h sys/syscall.h sys/ioctl.h]) AC_CHECK_HEADERS([sys/resource.h sys/wait.h sys/syscall.h sys/ioctl.h])
AC_CHECK_HEADERS([sys/sendfile.h sys/epoll.h sys/event.h]) AC_CHECK_HEADERS([sys/sendfile.h sys/epoll.h sys/event.h])
AC_CHECK_HEADERS([sys/sysctl.h sys/socket.h sys/sockio.h ifaddrs.h linux/netfilter_ipv4.h netinet/sctp.h]) AC_CHECK_HEADERS([sys/sysctl.h sys/socket.h sys/sockio.h sys/un.h ifaddrs.h linux/netfilter_ipv4.h netinet/sctp.h])
AC_CHECK_HEADERS([net/if.h net/if_dl.h], [], [], [ AC_CHECK_HEADERS([net/if.h net/if_dl.h], [], [], [
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h>]) #include <sys/socket.h>])

View File

@ -32,9 +32,12 @@
* The QSE_UTF8LEN_MAX macro defines the maximum number of bytes * The QSE_UTF8LEN_MAX macro defines the maximum number of bytes
* needed to form a single unicode character. * needed to form a single unicode character.
*/ */
#if QSE_SIZEOF_WCHAR_T == 2 #if (QSE_SIZEOF_WCHAR_T == QSE_SIZEOF_MCHAR_T)
/* cannot handle utf8 conversion properly */
# define QSE_UTF8LEN_MAX 1
#elif (QSE_SIZEOF_WCHAR_T == 2)
# define QSE_UTF8LEN_MAX 3 # define QSE_UTF8LEN_MAX 3
#elif QSE_SIZEOF_WCHAR_T == 4 #elif (QSE_SIZEOF_WCHAR_T == 4)
# define QSE_UTF8LEN_MAX 6 # define QSE_UTF8LEN_MAX 6
#else #else
# error Unsupported wide-character size # error Unsupported wide-character size

View File

@ -631,6 +631,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */ /* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H #undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <sys/un.h> header file. */
#undef HAVE_SYS_UN_H
/* Define to 1 if you have the <sys/wait.h> header file. */ /* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H #undef HAVE_SYS_WAIT_H

View File

@ -1207,9 +1207,8 @@ qse_ssize_t qse_fio_read (qse_fio_t* fio, void* buf, qse_size_t size)
return rab->rab$w_rsz; return rab->rab$w_rsz;
#else #else
ssize_t n; qse_ssize_t n;
if (size > (QSE_TYPE_MAX(qse_ssize_t) & QSE_TYPE_MAX(size_t))) if (size > QSE_TYPE_MAX(qse_ssize_t)) size = QSE_TYPE_MAX(qse_ssize_t);
size = QSE_TYPE_MAX(qse_ssize_t) & QSE_TYPE_MAX(size_t);
n = QSE_READ (fio->handle, buf, size); n = QSE_READ (fio->handle, buf, size);
if (n <= -1) fio->errnum = syserr_to_errnum (errno); if (n <= -1) fio->errnum = syserr_to_errnum (errno);
return n; return n;
@ -1312,9 +1311,8 @@ qse_ssize_t qse_fio_write (qse_fio_t* fio, const void* data, qse_size_t size)
#else #else
ssize_t n; qse_ssize_t n;
if (size > (QSE_TYPE_MAX(qse_ssize_t) & QSE_TYPE_MAX(size_t))) if (size > QSE_TYPE_MAX(qse_ssize_t)) size = QSE_TYPE_MAX(qse_ssize_t);
size = QSE_TYPE_MAX(qse_ssize_t) & QSE_TYPE_MAX(size_t);
n = QSE_WRITE (fio->handle, data, size); n = QSE_WRITE (fio->handle, data, size);
if (n <= -1) fio->errnum = syserr_to_errnum (errno); if (n <= -1) fio->errnum = syserr_to_errnum (errno);
return n; return n;
@ -1605,7 +1603,7 @@ int qse_fio_unlock (qse_fio_t* fio, qse_fio_lck_t* lck, int flags)
int qse_getstdfiohandle (qse_fio_std_t std, qse_fio_hnd_t* hnd) int qse_getstdfiohandle (qse_fio_std_t std, qse_fio_hnd_t* hnd)
{ {
#if defined(_WIN32) #if defined(_WIN32)
DWORD tab[] = static DWORD tab[] =
{ {
STD_INPUT_HANDLE, STD_INPUT_HANDLE,
STD_OUTPUT_HANDLE, STD_OUTPUT_HANDLE,
@ -1613,10 +1611,10 @@ int qse_getstdfiohandle (qse_fio_std_t std, qse_fio_hnd_t* hnd)
}; };
#elif defined(vms) || defined(__vms) #elif defined(vms) || defined(__vms)
/* TODO */ /* TODO */
int tab[] = { 0, 1, 2 }; static int tab[] = { 0, 1, 2 };
#else #else
qse_fio_hnd_t tab[] = static qse_fio_hnd_t tab[] =
{ {
#if defined(__OS2__) #if defined(__OS2__)
(HFILE)0, (HFILE)1, (HFILE)2 (HFILE)0, (HFILE)1, (HFILE)2

View File

@ -48,9 +48,12 @@
# include <tcp.h> /* watt-32 */ # include <tcp.h> /* watt-32 */
# undef AF_UNIX # undef AF_UNIX
#else #else
# include <sys/types.h>
# include <sys/socket.h> # include <sys/socket.h>
# include <netinet/in.h> # include <netinet/in.h>
# if defined(HAVE_SYS_UN_H)
# include <sys/un.h> # include <sys/un.h>
# endif
# if defined(QSE_SIZEOF_STRUCT_SOCKADDR_IN6) && (QSE_SIZEOF_STRUCT_SOCKADDR_IN6 <= 0) # if defined(QSE_SIZEOF_STRUCT_SOCKADDR_IN6) && (QSE_SIZEOF_STRUCT_SOCKADDR_IN6 <= 0)
# undef AF_INET6 # undef AF_INET6

View File

@ -56,6 +56,12 @@ static __utf8_t utf8_table[] =
static QSE_INLINE __utf8_t* get_utf8_slot (qse_wchar_t uc) static QSE_INLINE __utf8_t* get_utf8_slot (qse_wchar_t uc)
{ {
#if (QSE_SIZEOF_WCHAR_T == QSE_SIZEOF_MCHAR_T)
/* no utf8 support */
return QSE_NULL; /* invalid character */
#else
__utf8_t* cur, * end; __utf8_t* cur, * end;
QSE_ASSERT (QSE_SIZEOF(qse_mchar_t) == 1); QSE_ASSERT (QSE_SIZEOF(qse_mchar_t) == 1);
@ -71,6 +77,7 @@ static QSE_INLINE __utf8_t* get_utf8_slot (qse_wchar_t uc)
} }
return QSE_NULL; /* invalid character */ return QSE_NULL; /* invalid character */
#endif
} }
qse_size_t qse_uctoutf8 (qse_wchar_t uc, qse_mchar_t* utf8, qse_size_t size) qse_size_t qse_uctoutf8 (qse_wchar_t uc, qse_mchar_t* utf8, qse_size_t size)
@ -100,9 +107,12 @@ qse_size_t qse_uctoutf8 (qse_wchar_t uc, qse_mchar_t* utf8, qse_size_t size)
return (qse_size_t)cur->length; return (qse_size_t)cur->length;
} }
qse_size_t qse_utf8touc ( qse_size_t qse_utf8touc (const qse_mchar_t* utf8, qse_size_t size, qse_wchar_t* uc)
const qse_mchar_t* utf8, qse_size_t size, qse_wchar_t* uc)
{ {
#if (QSE_SIZEOF_WCHAR_T == QSE_SIZEOF_MCHAR_T)
/* no utf8 support */
return 0;
#else
__utf8_t* cur, * end; __utf8_t* cur, * end;
QSE_ASSERT (utf8 != QSE_NULL); QSE_ASSERT (utf8 != QSE_NULL);
@ -170,6 +180,7 @@ qse_size_t qse_utf8touc (
} }
return 0; /* error - invalid sequence */ return 0; /* error - invalid sequence */
#endif
} }
qse_size_t qse_utf8len (const qse_mchar_t* utf8, qse_size_t size) qse_size_t qse_utf8len (const qse_mchar_t* utf8, qse_size_t size)

View File

@ -88,7 +88,9 @@
# include "../cmn/syscall.h" # include "../cmn/syscall.h"
# include <sys/socket.h> # include <sys/socket.h>
# include <netinet/in.h> # include <netinet/in.h>
# if defined(HAVE_SYS_UN_H)
# include <sys/un.h> # include <sys/un.h>
# endif
# if defined(QSE_SIZEOF_STRUCT_SOCKADDR_IN6) && (QSE_SIZEOF_STRUCT_SOCKADDR_IN6 <= 0) # if defined(QSE_SIZEOF_STRUCT_SOCKADDR_IN6) && (QSE_SIZEOF_STRUCT_SOCKADDR_IN6 <= 0)
# undef AF_INET6 # undef AF_INET6
# endif # endif