Skip to content

Instantly share code, notes, and snippets.

@zah
Created August 11, 2011 12:26
Show Gist options
  • Save zah/1139525 to your computer and use it in GitHub Desktop.
Save zah/1139525 to your computer and use it in GitHub Desktop.
#define HTTP_STATUS_CODES(_) \
_(200, OK) \
_(404, NOT_FOUND) \
_(505, INTERNAL_ERROR)
enum StatusCodes {
#define GENERATE_ENUM(CODE, MSG) MSG = CODE,
HTTP_STATUS_CODES(GENERATE_ENUM)
}
const char* STATUS_CODE_STRING[] = {
#define GENERATE_STRING(CODE, MSG) #MSG,
HTTP_STATUS_CODES(GENERATE_STRING)
};
const* StatusCodeToString() ...
and so on..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment