Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro names are prone to collisions #2

Closed
andres-erbsen opened this issue Oct 23, 2012 · 2 comments
Closed

Macro names are prone to collisions #2

andres-erbsen opened this issue Oct 23, 2012 · 2 comments

Comments

@andres-erbsen
Copy link
Contributor

Using single words as macro names can lead to obscure compilation errors. For example, the ev namespace in libev C++ library has constants named READ and WRITE. Defining macros with the same names makes these constants inaccessible.
libev has a C library too and there the ev::READ constant is called EV_READ. A similar emulation of namespaces is probably needed for libsocket.

Some macro names from libsocket code: READ, WRITE, TCP, UDP, STREAM, VERBOSE, BACKLOG, BOTH, NUMERIC.

@dermesser
Copy link
Owner

What do you think of renaming them to LIBSOCKET_READ, LIBSOCKET_TCP etc.?

@dermesser
Copy link
Owner

master...new-macro-names

I hope I replaced everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants