[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Very basic traffic measurement for svnserve?

From: <kfogel_at_collab.net>
Date: 2005-03-01 05:12:35 CET

Justin Erenkrantz <justin@erenkrantz.com> writes:
> I could have sworn that we placed those 'temporary' functions under
> the svn namespace (svn_*). Placing it in the apr_* namespace is bad.

I have this memory that we did it with some apr_* names, but I'm too
lazy to dig it out of the archives. In any case, the important point
is that I am wrong about how #ifndef behaves :-), which explains the
miscommunication here!

I had thought #ifdef and #ifndef consider any symbols, not just things
defined with #define. IOW, this program would print "Hello, world!":

   #include <stdio.h>
   #ifndef printf
   int printf (const char *fmt, ...)
     char *str = "Ignore the arguments, just print this line instead.\n";
     int len = strlen (str);
     fwrite (str, 1, len, stdout);
     fflush (stdout);
     return 0;
   #endif /* printf !defined */
   int main ()
     printf ("Hello, world!\n");
     return 0;

But it prints out "Ignore the argument..." etc instead. I had
expected the entire #ifndef block to be a no-op, because we'd already
included stdio.h by then, but I was wrong. (We won't discuss the fact
that even if it behaved the way I thought, one might still
accidentally redefine foreign symbols at link time if one forgot to
include the right header, ahem.)

So if we ever did things that way, which I now doubt, it was eeeeevil,
and using svn_* prefixes, which I too recall we did on at least some
occasions, is the appropriate way.

For the purposes of what I was suggesting to Greg, this is all
irrelevant, as changing a prefix isn't the hard part of that task

Learn something every day,

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 1 05:31:03 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.