C and Makefile snippets
This commit is contained in:
parent
94457aae68
commit
e1711a1180
|
@ -105,7 +105,7 @@ snippet "(\w+) = malloc" "Automativ malloc error implementation" rA
|
||||||
`!p snip.rv = match.group(1)` = ($1*)malloc(sizeof(${1:int}) * $2);
|
`!p snip.rv = match.group(1)` = ($1*)malloc(sizeof(${1:int}) * $2);
|
||||||
if (!`!p snip.rv = match.group(1)`) {
|
if (!`!p snip.rv = match.group(1)`) {
|
||||||
/* Error */
|
/* Error */
|
||||||
(void)printf("malloc error on memory allocation of: `!p snip.rv = match.group(1)`!\n");
|
(void)printf("ERROR: malloc error on memory allocation of: `!p snip.rv = match.group(1)`!\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
$0
|
$0
|
||||||
|
|
|
@ -108,3 +108,9 @@ snippet rule "Add new Rule"
|
||||||
${1:all}: $2
|
${1:all}: $2
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
snippet clean "Clean the object files and binary file" b
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
${1:rm *.o $(BIN)}
|
||||||
|
endsnippet
|
||||||
|
|
Loading…
Reference in New Issue