Skip to content

Instantly share code, notes, and snippets.

View Ghost-VR's full-sized avatar
😫

Michael Yang Ghost-VR

😫
  • Apple Inc.
  • Santa Clara, CA
View GitHub Profile
@Ghost-VR
Ghost-VR / header.code-snippets
Last active June 5, 2024 00:20 — forked from coffeenotfound/h.code-snippets
Visual Studio Code Snippet: C/C++ Header Guard; Auto Include
{
"Add include guard": {
"prefix": "guard",
"description": "Adds an ifndef include guard to a C/C++ header",
"body": [
"#ifndef __${TM_FILENAME/^([^\\.]*)\\..*$/${1:/upcase}/}_${TM_FILENAME/^.*\\.([^\\.]*)$/${1:/upcase}/}__",
"#define __${TM_FILENAME/^([^\\.]*)\\..*$/${1:/upcase}/}_${TM_FILENAME/^.*\\.([^\\.]*)$/${1:/upcase}/}__",
"",
"$0",
"",