This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: jcf-path.c and filename case-insensitivity on Win32


Mohan Embar writes:
 > 
 > > > I'm going to stick my neck out here: would it be ethically/morally
 > > > objectionable to have platform-dependent files where we call into
 > > > platform-dependent same-named functions for things like these?
 > >
 > >In principle, but if we ever get into that much platform-dependent
 > >complexity in the compiler front end we are going it totally the
 > >wrong direction.
 > 
 > Why the distinction between the compiler front end and elsewhere in
 > gcj?  Everywhere I look in the code, MingW seems like the
 > proverbial black sheep, causing trouble and stirring things up for
 > the POSIX world. I agree with the general principle that
 > platform-specific code forks are undesirable, but why would the
 > compiler front end be more undesirable?

Because I don't think that it should be necessary.  A few #defines for
nasties like case-insensitivity are perhaps acceptable, but beyond
that, no.  If there is so much of a difference between the
environments then perhaps we (or really MingW) need a library into
which compatibility functions can go.

 > (A sidenote: the MingW build breaks at exactly the same place as this
 > attempted Mac OSX build: http://gcc.gnu.org/ml/java/2003-02/msg00325.html)
 > 
 > > > And if you're worried about performance on UNIX in the case of
 > > > something like strcmp,
 > >
 > >In the front end?  No way.  It must be right.
 > 
 > I didn't understand your last sentence. By "It must be right", do you
 > mean: "it must be implemented correctly/properly"?.

I mean "it" must be correct, and I don't want to start having #ifdefs
around strcmp/strcasecmp for the sake _only_ of efficiency.  We must
do it -- whatever it is -- correctly on the platform on which the
compiler runs.  If strcasecmp is correct on UNIX, we can use
strcasecmp on all platforms.  But I don't think strcasecmp is correct
on UNIX.

 > > > do a #define where things would resolve to the real deal on UNIX,
 > > > but a function call into the platform- dependent file on Win32?
 > > > 
 > > > I'm asking this because there are a few strategic opens / fopens
 > > > in jcf-*.c which, if you checked for the existence of the file
 > > > of the exact case on Win32, you would get the compiler working
 > > > on MingW.
 > >
 > >This should be possible to parameterize with a macro in the same way.
 > >Go for it.
 > 
 > I had thought about this too, but then I asked myself a general question:
 > how much of this macro stuff do we want to get into? The only advantage
 > I can see of a macro is to spare the overhead of another level of
 > indirection (another function call).

I don't think the distinction between functions and macros is
important.  If it's something short and simple, make it a macro.  In
this case AFAIK you only have to check the case of the file when you
open it.

But I'm not dictatorial about this.  Try it and see what it looks
like.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]