bug-vcdimager
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [VCDImager Bugs/Devel] Re: macos port


From: Rolando Abarca (aka funkaster)
Subject: Re: [VCDImager Bugs/Devel] Re: macos port
Date: Thu, 6 Mar 2003 10:47:25 -0300 (CLST)

On Wed, 5 Mar 2003, R. Bernstein wrote:

> Was looking at this problem now that the sourceforge Mac OSX box is
> back on line.
>
> Suppose we add in autoconf tests (e.g. AC_TRY_COMPILE) for how to
> handle packed?  So instead of:
>
> #if !defined(__GNUC__) ...
> # define PRAGMA_BEGIN_PACKED _Pragma("pack(1)")
>
> we have this config.h:
>
> #define PRAGMA_BEGIN_PACKED _Pragra("pack(1)")
>
> or whatever is appropriate.
>
> The next question then is what *is* appropriate for Mac OSX? Would it
> be wrong to just ignore this altogether?

I guess that for Mac OS X this is no problem, since OS X uses gcc 2.9x (or
at least it was the last time I used 10.1)
I compiled one of the latest cvs snapshots on my Mac OS 9 box.
I'm using MPW with MrC to compile. MrC claims to be C9X compliant, but
it's not 100% true. The above macros will not work with MrC, so the only
option is to leave all structs packed or add #ifdef macintosh/#endif to
add the appropriate #pragma before each structure.

> The other compilation problem is saw was the recently change C99 stuff
> where this:
>
>   vcd_image_source_funcs _funcs = {
>     read_mode2_sector: _read_mode2_sector,
>     stat_size: _stat_size,
>     free: _source_free,
>     setarg: _source_set_arg
>   };
>
> becomes this:
>
>   vcd_image_source_funcs _funcs = {
>     .read_mode2_sector = _read_mode2_sector,
>     .stat_size         = _stat_size,
>     .free              = _source_free,
>     .set_arg           = _source_set_arg
>   };
>
> A suggestion here is to have another configure test and a macro that
> foo(a,b) which expands to "a: b" or ".a = b" as appropriate.
>
> Comments?

again, for Mac OS X, this will work. For Mac OS 9 using MrC it won't
compile. I had to initialize the whole structure and add 0's to the fields
that are not set, something like this:

vcd_image_source_funcs _funcs = {
  _vcd_eject_media,
  _source_free,
  _vcd_get_default_device,
  0, /* get_track_count */
  0, /* get_track_lba */
  0, /* get_track_msf */
  0, /* get_track_size */
  _read_mode2_sector,
  0, /* read_mode2_sectors */
  _source_set_arg,
  _stat_size
};

This and more changes like that were necessary in order to compile
vcdimager under Mac OS 9.
Because not a lot of people will use it (I assume) and due to all the
changes needed in order to compile it using MrC, I think that it'll be a
waste of time to add the macos (please not that macos doesn't means macos
X, they're totally different things) port to the official distribution of
vcdimager.
I can offer to post the binaries/sources, but keeping them in sync with
the latest release of vcdimager will be hard, because unfortunately I
don't have that much spare time.
Anyway, those are my two cents after working a few days to compile
vcdimager on macos 9/MrC.
regards,
ra.-

#include <stdio.h> /*  square root by Newton's zero-finder method   */
#include <float.h> /*  by Rolando Abarca  rabarca at ing.uchile.cl  */
int main(int c, char* v[]){if (c==2){long d=atol(v[1]);double r1,r2=0;
double E=DBL_MIN;for(r1=(1+d)/2;((r1-r2>0)?r1-r2:r2-r1)>E;){r2=r1;r1=(
r2+d/r2)/2;}printf("%.15f\n",r1);}else printf(" usage: fsqrt <n>\n");}






reply via email to

[Prev in Thread] Current Thread [Next in Thread]