I read larbin source code recently. But I have a doubt. I the global.h file define the global class, at the end of this file have a macro like this:
#define setPoll(fds, event) \
global::pollfds[global::posPoll].fd = fds; \
global::pollfds[global::posPoll].events = event; \
global::posPoll++
But in the fetch/fetchPipe.cc file, call this macro like this:
global::setPoll(n, POLLOUT);
The question is why use global:: to call this macro? I think use
setPoll(n, POLLOUT);
is ok. Any body can tell me why?
The source code is a complete mess, it won’t even compile. It seems that
global.hhas been changed between version 2.2.2 and the current version 2.6.3 without addressing those changes infetch/fetchPipe.h. Also have a look at those include statements inglobal.cc:This code is outdated and not standard C++. There are several other things wrong. But back to your question: yes,
setPoll(n, POLLOUT);should be sufficient. Usingglobal::setPollwill not result in a bug, since this will expand toand
globalis astruct(see Mike Seymour’s comment).