🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

AngelScript 2.8.0 Crashes on Linux

Started by
32 comments, last by WitchLord 17 years, 4 months ago
Not sure whats going on, but here is what I get:

First One:
244

Second One
65524

Do what ever you want to the samples I converted, most of the code in it is redundant so you could put it all into it's own file, then just use one #ifdef to include it. The make file I made for the samples define _LINUX_ so you can use that.
Advertisement
I uploaded the three changed files(utils.h, test_optimize.cpp, test_conversion.cpp) and an updated makefile. I've tested this on Ubuntu and Fedora, but I didn't test to see if it breaks anything on Win32. I don't see any reason it would but you should definitely verify it.

http://ww2.jeremyh.net/test_feature-changes.zip


Jeremy
Thanks for sending me the changes. I'll incorporate them into the sdk.

About the conversion test. It seems that AngelScript is doing it the same way on Win32, as I also get 244 and 65524 respectively. The difference must be in how a negative float value is converted to unsigned integer by the C++ compiler.

What do you get out of (unsigned char)-12.3f? and (unsigned short)-12.3f?

On MSVC I get 244 and 65524. But my guess is that you get 12 and 12, right?

I think that I'll leave AngelScript as it is in this case, because having it do it differently on different platforms is not a good idea, even if that means it isn't doing the same thing as the C++ compiler.



AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've added you changes and tested them with Win32. Revision 112 should now have fully working samples and test_features on both Win32 and Linux.

Do you want to give it a try before I upload version 2.8.0a?

Thanks for all your help.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

The test_feature no longer works, looks like you removed __int64, thats not a type in Linux. It should be a "static long long int".

#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC++ 6	#define I64(x) x##l#else // MSVC++ 7, GNUC, etc	#ifndef __int64		typedef signed long long int __int64;	#endif	#define I64(x) x##ll#endif


If you change the old in utils.h with that it'll work. That and I had to add test_getargptr.cpp to the make file, so you need those two fixes.
Quote: Original post by WitchLord
What do you get out of (unsigned char)-12.3f? and (unsigned short)-12.3f?


I'm getting 0 when I try that.

Maybe I'm not doing what you wanted. I'm going to fix my server today, and send you an email tonight or tomorrow, so then you can check it out yourself.
Seems like gnuc doesn't like converting floats to unsigned byte or short. But that's ok. At least the conversion is done correctly inside AngelScript.

I'll change all use of __int64 to asINT64 which is defined correctly in angelscript.h.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Okay, don't forget to add test_getargptr.cpp to the make file.
Done! Revision 113 is now available with these latest changes.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I'll check it out in a little bit, I'm reinstalling Linux on my server and don't have internet access to my desktop right now. I'm in the LiveCD right now, but it should be done in a couple minutes.

This topic is closed to new replies.

Advertisement