From: Maximum V. <ven...@ms...> - 2010-10-15 10:55:50
|
i think replacing exit with return is a good idea. using exit does not add anything useful to begin with. it is already the case that no code should exist in programs after giving control to freeglut. this is dead code. i do not think it's worth maintaining this behavior. i expect it to do very little harm compared to what it is doing now. venom_zx |
From: Chris M. <ch...@al...> - 2010-10-15 13:59:27
|
John Fay writes: > > The primary issue here is maintaining compatibility > with GLUT. GLUT calls "exit"; therefore "freeglut" > will call "exit". I've already suggested a strategy for extending FreeGLUT to support "soft errors" in a comment to the feature request: 2116152 add fgError() exit callback/routine The idea is to add a command line argument to enable the "soft fail" mode and to return some status in the case of a fail of glutInit(). Once you've made it past that hurdle, everything else can be done within the current framework. > We've already added extensions to handle cases > in which the application programmer wants to do > something besides exiting Err, what are these and how do they solve the problem of FreeGLUT taking out the perl interpreter by calling exit on error? Cheers, Chris |
From: Diederick C. N. <dc...@gm...> - 2010-10-15 15:48:31
|
On Fri, Oct 15, 2010 at 21:01, Chris Marshall <ch...@al...> wrote: > John Fay writes: >> We've already added extensions to handle cases >> in which the application programmer wants to do >> something besides exiting John is probably referring to code like: glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,GLUT_ACTION_GLUTMAINLOOP_RETURNS); which would tell GLUT to return from glutMainLoop instead of exit when the mainloop is ended. IMO, given the mission statement of FreeGLUT, the only right way to handle such extensions is to make them optional, as is done now, and to have default behavior conform to that of GLUT. Although I have never run into a hard exit due to a call to fgError() myself, I can see that such option syntax as used for the mainloop return behavior would be useful here too. Best, Dee |
From: John F. <joh...@cy...> - 2010-10-15 12:32:55
|
The primary issue here is maintaining compatibility with GLUT. GLUT calls "exit"; therefore "freeglut" will call "exit". We've already added extensions to handle cases in which the application programmer wants to do something besides exiting. - John On 10/15/2010 5:55 AM, Maximum Venom wrote: > i think replacing exit with return is a good idea. using exit does not > add anything useful to begin with. it is already the case that no code > should exist in programs after giving control to freeglut. this is > dead code. i do not think it's worth maintaining this behavior. i > expect it to do very little harm compared to what it is doing now. > > venom_zx > > > ------------------------------------------------------------------------------ > Download new Adobe(R) Flash(R) Builder(TM) 4 > The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly > Flex(R) Builder(TM)) enable the development of rich applications that run > across multiple browsers and platforms. Download your free trials today! > http://p.sf.net/sfu/adobe-dev2dev > > > _______________________________________________ > Freeglut-developer mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > |
From: Maximum V. <ven...@ms...> - 2010-10-15 13:46:15
|
hi John, ok, that's a shame. i came across this topic is because i was having some trouble with the "exit" call. with mingw32-gcc i compiled C object-code, that just calls glutInit, glutCreateWindow, glutMainLoop (a test). mingw created object-code that required the "_exit" symbol. i'm also stuck using a linker that only supports run-time linking. the only symbol i couldn't find in the freeglut dll was the "_exit" symbol. i'm not sure if this is the right place to ask, but do you (or anyone else) know in which binary i can find the exit symbol? venom_zx Date: Fri, 15 Oct 2010 07:32:39 -0500 From: joh...@cy... To: fre...@li... Subject: Re: [Freeglut-developer] "return" instead of "exit"? Message body The primary issue here is maintaining compatibility with GLUT. GLUT calls "exit"; therefore "freeglut" will call "exit". We've already added extensions to handle cases in which the application programmer wants to do something besides exiting. - John On 10/15/2010 5:55 AM, Maximum Venom wrote: i think replacing exit with return is a good idea. using exit does not add anything useful to begin with. it is already the case that no code should exist in programs after giving control to freeglut. this is dead code. i do not think it's worth maintaining this behavior. i expect it to do very little harm compared to what it is doing now. venom_zx ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ Freeglut-developer mailing list Fre...@li... https://lists.sourceforge.net/lists/listinfo/freeglut-developer ------------------------------------------------------------------------------ Download new Adobe(R) Flash(R) Builder(TM) 4 The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly Flex(R) Builder(TM)) enable the development of rich applications that run across multiple browsers and platforms. Download your free trials today! http://p.sf.net/sfu/adobe-dev2dev _______________________________________________ Freeglut-developer mailing list Fre...@li... https://lists.sourceforge.net/lists/listinfo/freeglut-developer |
From: John T. <nu...@me...> - 2010-10-15 16:52:26
|
On Fri, Oct 15, 2010 at 03:46:08PM +0200, Maximum Venom wrote: > > i came across this topic is because i was having some trouble with the > "exit" call. with mingw32-gcc i compiled C object-code, that just > calls glutInit, glutCreateWindow, glutMainLoop (a test). > > mingw created object-code that required the "_exit" symbol. i'm also > stuck using a linker that only supports run-time linking. the only > symbol i couldn't find in the freeglut dll was the "_exit" symbol. i'm > not sure if this is the right place to ask, but do you (or anyone > else) know in which binary i can find the exit symbol? _exit is a standard POSIX libc function which actually calls the system call exit. The exit function is a wrapper arround that which performs cleanup tasks such as calling the atexit callbacks before actually calling _exit. Another possibility is that your linker requires underscores in front of public symbols, I seem to remember that some DOS linkers did that, maybe windows linkers do it as well, I can't remember. In that case what you're seeing is in fact the actual exit function being unresolved. In both cases, you're probably not linking with a proper libc or not linking correctly. If you can't link with libc, you're in a "freestanding" environment, where you must implement any standard library function that you need to use (this is often the case with cross-compiling for embedded systems or kernel development obviously). -- John Tsiombikas http://nuclear.mutantstargoat.com/ |
From: Maximum V. <ven...@ms...> - 2010-10-17 11:07:31
|
thank you John Tsiombikas, you pointed me in the right direction. exit works now by linking to msvcrt.dll. i was trying to call freeglut from a functional language. venom_zx > Date: Fri, 15 Oct 2010 18:52:18 +0200 > From: nu...@me... > To: fre...@li... > Subject: Re: [Freeglut-developer] "return" instead of "exit"? > > On Fri, Oct 15, 2010 at 03:46:08PM +0200, Maximum Venom wrote: > > > > i came across this topic is because i was having some trouble with the > > "exit" call. with mingw32-gcc i compiled C object-code, that just > > calls glutInit, glutCreateWindow, glutMainLoop (a test). > > > > mingw created object-code that required the "_exit" symbol. i'm also > > stuck using a linker that only supports run-time linking. the only > > symbol i couldn't find in the freeglut dll was the "_exit" symbol. i'm > > not sure if this is the right place to ask, but do you (or anyone > > else) know in which binary i can find the exit symbol? > > _exit is a standard POSIX libc function which actually calls the system > call exit. The exit function is a wrapper arround that which performs > cleanup tasks such as calling the atexit callbacks before actually > calling _exit. > > Another possibility is that your linker requires underscores in front of > public symbols, I seem to remember that some DOS linkers did that, maybe > windows linkers do it as well, I can't remember. In that case what > you're seeing is in fact the actual exit function being unresolved. > > In both cases, you're probably not linking with a proper libc or not > linking correctly. If you can't link with libc, you're in a > "freestanding" environment, where you must implement any standard > library function that you need to use (this is often the case with > cross-compiling for embedded systems or kernel development obviously). > > -- > John Tsiombikas > http://nuclear.mutantstargoat.com/ > > ------------------------------------------------------------------------------ > Download new Adobe(R) Flash(R) Builder(TM) 4 > The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly > Flex(R) Builder(TM)) enable the development of rich applications that run > across multiple browsers and platforms. Download your free trials today! > http://p.sf.net/sfu/adobe-dev2dev > _______________________________________________ > Freeglut-developer mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer |