Changeset 4285


Ignore:
Timestamp:
Jan 20, 2010, 8:59:01 AM (7 years ago)
Author:
sam
Message:

Improve the OpenSolaris? port: support for FILE structures, and a few
additional defines to activate libc features.

Location:
zzuf/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/configure.ac

    r4262 r4285  
    9393AC_TRY_COMPILE([#include <stdio.h>],
    9494 [FILE *fp; fp->_IO_read_ptr++; fp->_IO_read_end++],
    95  [ac_cv_have_file_io_read_ptr=yes],
    96  [ac_cv_have_file_io_read_ptr=no])
    97 AC_MSG_RESULT($ac_cv_have_file_io_read_ptr)
    98 if test "$ac_cv_have_file_io_read_ptr" != "no"; then
     95 [ac_cv_have_glibc_file=yes],
     96 [ac_cv_have_glibc_file=no])
     97AC_MSG_RESULT($ac_cv_have_glibc_file)
     98if test "$ac_cv_have_glibc_file" != "no"; then
    9999  AC_DEFINE(HAVE_GLIBC_FILE, 1, [Define to 1 if FILE has glibc-style members])
    100100fi
     
    103103AC_TRY_COMPILE([#include <stdio.h>],
    104104 [FILE *fp; fp->_bf._base++; fp->_r++; fp->_p++],
    105  [ac_cv_have_file_bf_base=yes],
    106  [ac_cv_have_file_bf_base=no])
    107 AC_MSG_RESULT($ac_cv_have_file_bf_base)
    108 if test "$ac_cv_have_file_bf_base" != "no"; then
     105 [ac_cv_have_freebsd_file=yes],
     106 [ac_cv_have_freebsd_file=no])
     107AC_MSG_RESULT($ac_cv_have_freebsd_file)
     108if test "$ac_cv_have_freebsd_file" != "no"; then
    109109  AC_DEFINE(HAVE_FREEBSD_FILE, 1, [Define to 1 if FILE has FreeBSD-style members])
     110fi
     111
     112AC_MSG_CHECKING([for _base, _cnt and _ptr in FILE (Solaris-style)])
     113AC_TRY_COMPILE([#include <stdio.h>],
     114 [FILE *fp; fp->_base++; fp->_cnt++; fp->_ptr++],
     115 [ac_cv_have_solaris_file=yes],
     116 [ac_cv_have_solaris_file=no])
     117AC_MSG_RESULT($ac_cv_have_solaris_file)
     118if test "$ac_cv_have_solaris_file" != "no"; then
     119  AC_DEFINE(HAVE_SOLARIS_FILE, 1, [Define to 1 if FILE has Solaris-style members])
    110120fi
    111121
     
    115125AC_TRY_COMPILE(
    116126 [#define _LARGEFILE64_SOURCE
     127  #define _LARGEFILE_SOURCE
    117128  #include <stdio.h>],
    118129 [fpos64_t x; long long int y = x.__pos;],
     
    120131AC_TRY_COMPILE(
    121132 [#define _LARGEFILE64_SOURCE
     133  #define _LARGEFILE_SOURCE
    122134  #include <stdio.h>],
    123135 [fpos64_t x; long long int y = (long long int)x;],
  • zzuf/trunk/msvc/config.h

    r4263 r4285  
    8383#define HAVE_SOCKET 1
    8484/* #undef HAVE_SOCKLEN_T */
     85/* #undef HAVE_SOLARIS_FILE */
    8586#define HAVE_STDINT_H 1
    8687#define HAVE_STDLIB_H 1
  • zzuf/trunk/src/libzzuf/lib-fd.c

    r4262 r4285  
    2525/* Use this to get lseek64() on glibc systems */
    2626#define _LARGEFILE64_SOURCE
     27/* Use this to get off64_t() on Solaris systems */
     28#define _LARGEFILE_SOURCE
    2729/* Use this to get proper prototypes on HP-UX systems */
    2830#define _XOPEN_SOURCE_EXTENDED
  • zzuf/trunk/src/libzzuf/lib-signal.c

    r4253 r4285  
    2121/* Needed for struct sigaction on HP-UX */
    2222#define _INCLUDE_POSIX_SOURCE
     23/* Needed for struct sigaction on OpenSolaris */
     24#define __EXTENSIONS__
    2325
    2426#if defined HAVE_STDINT_H
  • zzuf/trunk/src/libzzuf/lib-stream.c

    r4260 r4285  
    171171#elif defined HAVE_FREEBSD_FILE
    172172    return (uint8_t *)stream->_p;
     173#elif defined HAVE_SOLARIS_FILE
     174    return (uint8_t *)stream->_ptr;
    173175#else
    174176    (void)stream;
     
    184186#elif defined HAVE_FREEBSD_FILE
    185187    return (int)((uint8_t *)stream->_p - (uint8_t *)stream->_bf._base);
     188#elif defined HAVE_SOLARIS_FILE
     189    return (int)((uint8_t *)stream->_ptr - (uint8_t *)stream->_base);
    186190#else
    187191    (void)stream;
     
    197201#elif defined HAVE_FREEBSD_FILE
    198202    return stream->_r;
     203#elif defined HAVE_SOLARIS_FILE
     204    return stream->_cnt;
    199205#else
    200206    (void)stream;
Note: See TracChangeset for help on using the changeset viewer.