Skip to content

Instantly share code, notes, and snippets.

@0xF6
Created September 17, 2020 15:50
Show Gist options
  • Save 0xF6/42e973ae3d57f24b6f9b2930a40bdec4 to your computer and use it in GitHub Desktop.
Save 0xF6/42e973ae3d57f24b6f9b2930a40bdec4 to your computer and use it in GitHub Desktop.
#pragma once
#if defined(__GNUC__) || (defined(__ICC) && (__ICC >= 600))
#define G_FUNCTION_NAME __PRETTY_FUNCTION__
#elif defined(__FUNCSIG__)
#define G_FUNCTION_NAME __FUNCSIG__
#elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600))
#define G_FUNCTION_NAME __FUNCTION__
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
#define G_FUNCTION_NAME __func__
#elif defined(__cplusplus) && (__cplusplus >= 201103)
#define G_FUNCTION_NAME __func__
#else
#error "Function name is N/A"
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment