[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[VCDImager Bugs/Devel] Re: macos port
From: |
R. Bernstein |
Subject: |
[VCDImager Bugs/Devel] Re: macos port |
Date: |
Wed, 5 Mar 2003 22:15:11 -0500 |
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?
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?
> On Mon, 2003-03-03 at 14:28, Rolando Abarca (aka funkaster) wrote:
> > Hi,
>
> > I compiled the code in the cvs repository and it's working. I only had a
> > problem with some structures that needed to be packed.
> > In vcd_types.h you define this:
>
> > #if !defined(__GNUC__) && !defined(macintosh)
> > /* should work with most EDG-frontend based compilers */
> > # define PRAGMA_BEGIN_PACKED _Pragma("pack(1)")
> > # define PRAGMA_END_PACKED _Pragma("pack()")
> > #else
> > /* for GCC we try to use GNUC_PACKED instead */
> > # define PRAGMA_BEGIN_PACKED
> > # define PRAGMA_END_PACKED
> > #endif
>
> > the problem here (at least for MacOS) is that I can't include preprocessor
> > directives in a preprocessor directive, although #pragma is not really a
> > preprocessor directive.
>
> that's what ISO C99's _Pragma() is for btw... otherwise I would have
> used '#pragma' directly above...
>
> > So a simple solution was to add -align packed to
> > the C compiler options. This packs every structure. I don't know the side
> > effects of this.
>
> most likely some structures defined in the standard system headers will
> get compacted as well... the question remains, whether this changes
> anything relevant on the ABI level...
>
> > Another solution could be to add #ifdef macintosh/#endif
> > between every struct that needs to be packed and there add the #pragma.
>
> ...extremely ugly :-/ of course you can do that, but I won't add
> something like that to CVS so soon...
>
> > One last thing: I don't know how you feel about this macos port, I mean if
> > you want it to be "official" or just unsopported. I can send you the files
> > that needed some changes to make them work with macos...
>
> if the changes are minimal, I'll most likely merge them, but stuff like
> adding #ifdef macintosh around various places is not going to be
> merged... ;-)
>
> > #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");}
> --
> Herbert Valerio Riedel / Phone: (EUROPE) +43-1-58801-18840
> Email: address@hidden / Finger address@hidden for GnuPG Public Key
> GnuPG Key Fingerprint: 7BB9 2D6C D485 CE64 4748 5F65 4981 E064 883F 4142
>
>
>
> _______________________________________________
> Bug-VCDImager mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-vcdimager