AW: Compile ClearSilver on System i

"Schmidt, Mihael" <[email protected]> Fri, 12 Jun 2009 07:45:01 +0200
Newsgroups gmane.text.clearsilver.general
Message-ID <[email protected]>
After some searching on the web I found that HAVE_LOCKF is queried in Clearsilver.h. There is seems that ulock, rcfs, dict and skiplist are optional (are not included if not supported on the system). Is that so? Can I go on with the rest of the sources?

Thanx for any help in advance

Mihael 

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] Im Auftrag von Schmidt, Mihael
Gesendet: Freitag, 12. Juni 2009 07:34
An: [email protected]
Betreff: AW: Compile ClearSilver on System i



oh... it is util/ulocks.c (not util.ulock.c)

I compiled clearsilver on a linux system and took the cs_config.h from it (and modified it a little bit). Now i see that there is a setting for the availability of lockf() :

/* Does your system have lockf ? */
/* #define HAVE_LOCKF 1 */

On the linux system there is of course lockf() but not on System i. So I put it in comments. But it does not seem to do anything. Haven't found anything in ulocks.c or ulocks.h.

Can I somehow use fcntl() instead of lockf() as a workaround?

Any idea?

Mihael 

-----Ursprüngliche Nachricht-----
Von: [email protected] <mailto:ClearSilver%40yahoogroups.com>  [mailto:[email protected] <mailto:ClearSilver%40yahoogroups.com> ] Im Auftrag von Schmidt, Mihael
Gesendet: Freitag, 12. Juni 2009 07:17
An: [email protected] <mailto:ClearSilver%40yahoogroups.com> 
Betreff: AW: Compile ClearSilver on System i

-- Schmidt, Mihael wrote:
> Question: Why is dict.c calling nerr_raise with only 2 parm. Shouldn't
it be
> three parms (error type, format string and error message)? I
definitely got
> something wrong but I don't know what?

nerr_raise() is setup to work like the printf() family of functions. For
example, you might have:

nerr_raise(NERR_ASSERT, "problematic value %d", local_variable_int);

Because the statement you referenced has no % formatting, it has no
arguments.
nerr_raise(NERR_ASSERT, "value or new are NULL");

Mihael: ... and that was my problem. The ILE C compiler expects to have
at least one variable argument if __VA_ARGS__ is used. I added an empty
string and it works now, like:

nerr_raise(NERR_ASSERT, "value or new are NULL", "");

But now I got another problem: The lockf() function is not available on
System i for ILE C. Is there a way to replace this function? A
workaround?

lockf() is used in util/ulock.c, function fLock and fFind.

Any ideas would be great.

Thanx in advance.

Mihael