Skip to content

Instantly share code, notes, and snippets.

@Youlean
Created October 15, 2022 11:16
Show Gist options
  • Save Youlean/daed25b08861eed0a4b90ddd8e9559d1 to your computer and use it in GitHub Desktop.
Save Youlean/daed25b08861eed0a4b90ddd8e9559d1 to your computer and use it in GitHub Desktop.
Print Visual Studio Warning
// Required code
#define STRING2(x) #x
#define STRING(x) STRING2(x)
#define warning_vs(t) message(__FILE__ "(" STRING(__LINE__) "): warning: " STRING(t))
// Example Usage
#pragma warning_vs("This is my custom warning")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment