info-sather
[Top][All Lists]
Advanced

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

Re: [info-sather] Recursive copy (was: How's Sather coming along?)v


From: Sather User
Subject: Re: [info-sather] Recursive copy (was: How's Sather coming along?)v
Date: Sun, 16 Dec 2012 14:10:44 +1030 (CST)

Let me have yet another try because it brings up an interesting point
re compile-time constants.  The main class in the fiddled version
should have had something like:

  const is_defined__use_atfile:BOOL := UTIME::is_defined__use_atfile;

near the top or outside any method, globally.

UTIME::is_defined__use_atfile is in effect a call of an external C
function with #ifdefs to test whether __USE_ATFILE is defined.  That
decides whether to use an external call of utimensat(2) to set times
with nanosecond precision, or, instead, it's necessary to use
utimes(2), which has microsecond precision and always follows
symlinks.  (And seems to work on a Sather 2.6.26 system with only full
second inode times.)

However, it gets called at compile time if assigned to a const as above.

So, even though there is a function call, the Sather construct is
functionally equivalent to a cpp #define.  (Except that it isn't a
symbolic literal but a constant value with an identifier.)

Merry Christmas to all.

-- 
Michael Talbot-Wilson



reply via email to

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