| View previous topic :: View next topic |
| Author |
Message |
fluke
Joined: 26 Jul 2004 Posts: 25
|
Posted: Sat Jul 31, 2004 9:52 am Post subject: putchar() from kernel.h clobbered by stdio.h |
|
|
I ran into a problem where the pre-compiler clobbered the proto for putchar() from kernel.c
What came form the include was in ps2sdk/ee/kernel.h line 272:
int putchar(int c);
After the pre-compiler used the defines from ps2dev/ee/ee/include/stdio.h the result was:
int (--((_impure_ptr->_stdout))->_w < 0 ? ((_impure_ptr->_stdout))->_w >= ((_imp
ure_ptr->_stdout))->_lbfsize ? (*((_impure_ptr->_stdout))->_p = (int c)), *((_im
pure_ptr->_stdout))->_p != '\n' ? (int)*((_impure_ptr->_stdout))->_p++ : __swbuf
('\n', (_impure_ptr->_stdout)) : __swbuf((int)(int c), (_impure_ptr->_stdout)) :
(*((_impure_ptr->_stdout))->_p = (int c), (int)*((_impure_ptr->_stdout))->_p++)
);
This finally results in a fatal compiler error that a parse error occured before '--' token.
If I comment out the proto from the kernel header file then the compiler complettes. |
|
| Back to top |
|
 |
pixel
Joined: 30 Jan 2004 Posts: 791
|
Posted: Sat Jul 31, 2004 12:03 pm Post subject: |
|
|
Yeah... there's always a conflict between the "ps2sdk's libC" and the "newlib"... ho well :) _________________ pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department. |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Sun Aug 01, 2004 2:26 am Post subject: |
|
|
| There shouldn't be any conflicts. putchar() should be moved to stdio.h in ps2sdk, and if you want to use newlib's stdio.h use angle brackets <>, but if you want to use ps2sdk's stdio.h use quotes and make sure the include path to ps2sdk's stdio.h is among the first in the -I flags. |
|
| Back to top |
|
 |
|