Reducing code duplication between client and server

Do you guys follow any technique to reduce the amount of code duplication between client and server code? Macros or something?

Put the code in a file that is compiled into both the client and server. Most or all of the files in the code/qcommon/ directory is.