Skip to content

Instantly share code, notes, and snippets.

@travisdowns
Created May 3, 2019 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save travisdowns/eb1287406ddd6fb30073c339838537fc to your computer and use it in GitHub Desktop.
Save travisdowns/eb1287406ddd6fb30073c339838537fc to your computer and use it in GitHub Desktop.
// if NOPCOUNT is not defined, use 0 which makes NOPS a no-op
#ifndef NOPCOUNT
#define NOPCOUNT 0
#endif
#define NOPS_HELPER2(N) asm(".rept " #N ";nop;.endr");
#define NOPS_HELPER1(N) NOPS_HELPER2(N)
#define NOPS NOPS_HELPER1(NOPCOUNT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment