Skip to content

Instantly share code, notes, and snippets.

@javierguzman
Created March 6, 2020 14:46
Show Gist options
  • Save javierguzman/87ac97007206f43feeb033a3e7abd30c to your computer and use it in GitHub Desktop.
Save javierguzman/87ac97007206f43feeb033a3e7abd30c to your computer and use it in GitHub Desktop.
Porting Scenarios
// Scenario 1 -> default behavior keeps changing:
// TODAY
#if defined(PORTING_X)
useMemory1()
#else
useMemory2()
#endif
//TOMORROW
#if defined(PORTING_X)
useMemory2()
#else
useMemory1()
#endif
//Above does not need PORTING flag then.
//Scenario 2 -> behavior changes when we change flags
//TODAY
#if defined(PORTING_X)
useMemory1()
#else
useMemory2()
#endif
//TOMORROW
#if defined(PORTING_X)
useMemory1()
#else
useMemory2()
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment