-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'misc-fixes' of https://github.com/visendev/pnut into mi…
…sc-fixes
- Loading branch information
Showing
13 changed files
with
143 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// tests for __FILE__, __LINE__, __DATE__, __TIME__, __TIMESTAMP__ built-in macros | ||
#include <stdio.h> | ||
|
||
#ifndef __FILE__ | ||
#error "__FILE__ is not defined" | ||
#endif | ||
#ifndef __LINE__ | ||
#error "__LINE__ is not defined" | ||
#endif | ||
#ifndef __DATE__ | ||
#error "__DATE__ is not defined" | ||
#endif | ||
#ifndef __TIME__ | ||
#error "__TIME__ is not defined" | ||
#endif | ||
#ifndef __TIMESTAMP__ | ||
#error "__TIMESTAMP__ is not defined" | ||
#endif | ||
|
||
void putint(int n) { | ||
if (n < 0) { | ||
putchar('-'); | ||
putint(-n); | ||
} else if (n > 9) { | ||
putint(n / 10); | ||
putchar('0' + n % 10); | ||
} else { | ||
putchar('0' + n); | ||
} | ||
} | ||
|
||
void putstr(char *str) { | ||
while (*str) { | ||
putchar(*str); | ||
str += 1; | ||
} | ||
} | ||
|
||
int main() { | ||
putstr(__FILE__); putchar('\n'); | ||
putint(__LINE__); putchar('\n'); | ||
putstr(__DATE__); putchar('\n'); | ||
putstr(__TIME__); putchar('\n'); | ||
putstr(__TIMESTAMP__); putchar('\n'); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tests/_all/preprocessor/macro/builtin-stubbed.c | ||
0 | ||
Jan 1 1970 | ||
00:00:00 | ||
Jan 1 1970 00:00:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// tests for __FILE__, __LINE__, __DATE__, __TIME__, __TIMESTAMP__ built-in macros | ||
// comp_pnut_opt: -DINCLUDE_LINE_NUMBER_ON_ERROR | ||
#include "builtin-stubbed.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tests/_all/preprocessor/macro/builtin-stubbed.c | ||
41 | ||
Jan 1 1970 | ||
00:00:00 | ||
Jan 1 1970 00:00:00 |