[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Goo porting questions
I've been working some more on the Win32 MSVC port and I've got a
couple of questions/comments.
Currently I'm not using 'inline' functions with MSVC because I get
linker errors like the following:
%lock.obj : error LNK2001: unresolved external symbol _allocate
math.obj : error LNK2001: unresolved external symbol _YPfi2f
math.obj : error LNK2001: unresolved external symbol _YPfE
math.obj : error LNK2001: unresolved external symbol _YPfL
math.obj : error LNK2001: unresolved external symbol _YPfA
math.obj : error LNK2001: unresolved external symbol _YPf_
[...snip...]
This is caused by functions defined in grt.c as inline. In MSVC all
inline functions must exist in a header file included by the .c file
that uses them, otherwise they'll not be linked at all as they don't
'exist' having been inlined in the module where they live (grt.c).
What's a good way of working around this? Move the INLINE functions in
grt.c to a header file? Don't make them inline?
In the meantime I'm creating a LOCAL_INLINE which is 'inline' for gcc
and nothing for MSVC and I'll modify the grt.c inline functions to use
this. The inline functions in grt.h will remain as INLINE. Maybe not a
good long term solution as it causes a lot of functions that could be
inline to not be inlined. I'd like to opt for moving them into grt.h
or another header file perhaps? Thoughts?
I could leave inline out completely for MSVC but it makes Goo a bit
slower.
My other question is what to do about generating makefiles for
MSVC. Currently I see the makefile is generated by 'generate-makefile'
in g2c.goo and it uses Gnu makefiles.
What's a good way of adding support for generating makefiles for
Microsoft make? Or for other build systems (I'd like to get support
going for Symbian operating systems for example which uses their own
make type system).
Is it worth adding some sort of c-backend identifier that things like
generate-makefile can dispatch on? Or does that add too much knowledge
to the Goo code about the build system? Other ideas?
Chris.