Skip to content

Instantly share code, notes, and snippets.

@jspahrsummers
Last active December 10, 2015 07:38
Show Gist options
  • Save jspahrsummers/4402020 to your computer and use it in GitHub Desktop.
Save jspahrsummers/4402020 to your computer and use it in GitHub Desktop.
This simple script will preprocess one or more source files, and try to indent them nicely such that expanded macros are made readable. This is useful for debugging the logic of rampant macros.
#!/bin/sh
#
# Example usage:
# ./macroview.sh -IThirdPartyHeadersToInclude file.m
clang -E -nostdinc -nobuiltininc "$@" 2>/dev/null | indent -bl -nce -nei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment