Hi Guilhem, > 2006-01-28 Guilhem Lavaux <[EMAIL PROTECTED]> > > * configure.ac: Removed target from CLASSPATH_INCLUDES and > Makefile generation. > > * native/jni/native-lib/Makefile.am, > native/jni/native-lib/cpnet.h, > native/jni/native-lib/cpnet.c > native/jni/native-lib/cpio.h, > native/jni/native-lib/cpio.c, > native/jni/native-lib/cpmath.h: Imported new native > compatibility layer.
A lot of code is written to just return the errno value, except in the 'normal' no-error case. There we try to translate between 0 and CPNATIVE_OK. Like: > + *fd = open (filename, sflags, perms); > + > + if (*fd < 0) > + return errno; > + > + return CPNATIVE_OK; Why not use the normal semantics of errno everywhere? Similar for some other defines like: > + if (flags & CPFILE_FLAG_CREATE) > + sflags |= O_CREAT; > + if (flags & CPFILE_FLAG_APPEND) > + sflags |= O_APPEND; > + if (flags & CPFILE_FLAG_TRUNCATE) > + sflags |= O_TRUNC; > + if (flags & CPFILE_FLAG_SYNC) > + sflags |= O_SYNC; > + if (flags & CPFILE_FLAG_DSYNC) > + sflags |= O_DSYNC; > +#if defined(O_BINARY) > + if (flags & CPFILE_FLAG_BINARY) > + sflags |= O_BINARY; > +#endif Is it really necessary to redefine these kinds of posix constants? it looks to me this code can be made much simpler if we just assume we can use the well known posix constants and define them with an autoconf check for those platforms that don't have them already. In cpmath.h you define some macros for compilers that cannot handle jlong as a 64bit type. But are there actually such compilers that we support? If not, then I think this just clutters the code. Cheers, Mark
signature.asc
Description: This is a digitally signed message part