forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

putchar() from kernel.h clobbered by stdio.h

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
fluke



Joined: 26 Jul 2004
Posts: 25

PostPosted: Sat Jul 31, 2004 9:52 am    Post subject: putchar() from kernel.h clobbered by stdio.h Reply with quote

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
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Sat Jul 31, 2004 12:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sun Aug 01, 2004 2:26 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group