|
38 | 38 | #include <sys/stat.h>
|
39 | 39 | #endif
|
40 | 40 |
|
| 41 | +// Helper macro to mark unused parameters and prevent compiler warnings. |
| 42 | +// Appends _UNUSED to the variable name to prevent accidentally using them. |
| 43 | +#ifdef __GNUC__ |
| 44 | +# define UNUSED(x) x ## _UNUSED __attribute__((__unused__)) |
| 45 | +#else |
| 46 | +# define UNUSED(x) x ## _UNUSED |
| 47 | +#endif |
| 48 | + |
41 | 49 | /*----------------------------------------------------------------------------
|
42 | 50 | * Exported variables
|
43 | 51 | *----------------------------------------------------------------------------*/
|
@@ -69,39 +77,39 @@ extern caddr_t _sbrk ( int incr )
|
69 | 77 | return (caddr_t) prev_heap ;
|
70 | 78 | }
|
71 | 79 |
|
72 |
| -extern int link( char *cOld, char *cNew ) |
| 80 | +extern int link( UNUSED(char *cOld), UNUSED(char *cNew) ) |
73 | 81 | {
|
74 | 82 | return -1 ;
|
75 | 83 | }
|
76 | 84 |
|
77 |
| -extern int _close( int file ) |
| 85 | +extern int _close( UNUSED(int file) ) |
78 | 86 | {
|
79 | 87 | return -1 ;
|
80 | 88 | }
|
81 | 89 |
|
82 |
| -extern int _fstat( int file, struct stat *st ) |
| 90 | +extern int _fstat( UNUSED(int file), struct stat *st ) |
83 | 91 | {
|
84 | 92 | st->st_mode = S_IFCHR ;
|
85 | 93 |
|
86 | 94 | return 0 ;
|
87 | 95 | }
|
88 | 96 |
|
89 |
| -extern int _isatty( int file ) |
| 97 | +extern int _isatty( UNUSED(int file) ) |
90 | 98 | {
|
91 | 99 | return 1 ;
|
92 | 100 | }
|
93 | 101 |
|
94 |
| -extern int _lseek( int file, int ptr, int dir ) |
| 102 | +extern int _lseek( UNUSED(int file), UNUSED(int ptr), UNUSED(int dir) ) |
95 | 103 | {
|
96 | 104 | return 0 ;
|
97 | 105 | }
|
98 | 106 |
|
99 |
| -extern int _read(int file, char *ptr, int len) |
| 107 | +extern int _read(UNUSED(int file), UNUSED(char *ptr), UNUSED(int len) ) |
100 | 108 | {
|
101 | 109 | return 0 ;
|
102 | 110 | }
|
103 | 111 |
|
104 |
| -extern int _write( int file, char *ptr, int len ) |
| 112 | +extern int _write( UNUSED(int file), char *ptr, int len ) |
105 | 113 | {
|
106 | 114 | int iIndex ;
|
107 | 115 |
|
@@ -129,7 +137,7 @@ extern void _exit( int status )
|
129 | 137 | for ( ; ; ) ;
|
130 | 138 | }
|
131 | 139 |
|
132 |
| -extern void _kill( int pid, int sig ) |
| 140 | +extern void _kill( UNUSED(int pid), UNUSED(int sig) ) |
133 | 141 | {
|
134 | 142 | return ;
|
135 | 143 | }
|
|
0 commit comments