aboutsummaryrefslogtreecommitdiffstats
path: root/docs/getting_started_introduction.md
diff options
context:
space:
mode:
authorGravatar Evan Travers <evantravers@gmail.com>2018-07-14 16:49:07 -0500
committerGravatar Jack Humbert <jack.humb@gmail.com>2018-07-15 13:21:20 -0400
commitc5c112ae2927d2d026de16cc4cdfd692bb6e7ab9 (patch)
tree1cd988114abeb936dea7d188863b1db87fb30bc6 /docs/getting_started_introduction.md
parent3d7bfae2323f64778b1e9c6b402c84befaa30301 (diff)
downloadqmk_firmware-c5c112ae2927d2d026de16cc4cdfd692bb6e7ab9.tar.gz
Update config.h boilerplate to use `#pragma once`
According to @fredizzimo, this is a safer and easier way to handle the boilerplate.
Diffstat (limited to 'docs/getting_started_introduction.md')
-rw-r--r--docs/getting_started_introduction.md14
1 files changed, 3 insertions, 11 deletions
diff --git a/docs/getting_started_introduction.md b/docs/getting_started_introduction.md
index 82a1ca19a..3b6a488ed 100644
--- a/docs/getting_started_introduction.md
+++ b/docs/getting_started_introduction.md
@@ -35,15 +35,10 @@ There are 3 possible `config.h` locations:
* userspace (`/users/<user>/config.h`)
* keymap (`/keyboards/<keyboard>/keymaps/<keymap>/config.h`)
-The build system automatically picks up the config files in the above order. If you wish to override any setting set by a previous `config.h` you will need to first include some boilerplate code around the settings you wish to change.
+The build system automatically picks up the config files in the above order. If you wish to override any setting set by a previous `config.h` you will need to first include some boilerplate code for the settings you wish to change.
```
-#ifndef CONFIG_USER_H
-#define CONFIG_USER_H
-
-// overrides go here!
-
-#endif
+#pragma once
```
Then to override a setting from the previous `config.h` file you must `#undef` and then `#define` the setting again.
@@ -51,12 +46,9 @@ Then to override a setting from the previous `config.h` file you must `#undef` a
The boilerplate code and setting look like this together:
```
-#ifndef CONFIG_USER_H
-#define CONFIG_USER_H
+#pragma once
// overrides go here!
#undef MY_SETTING
#define MY_SETTING 4
-
-#endif
```