Issue 134: inline bug
Status:  Fixed
Owner: ----
Closed:  Feb 2012
Reported by michaelbaczynski@gmail.com, Aug 30, 2011
haxelib install polygonal

then compile this class (haXe from svn):

class Main {
  static function main() {
    de.polygonal.ds.mem.IntMemory;
  }
}

results in:
./src/de/polygonal/ds/mem/IntMemory.cpp(706) : error C2065: '__global__' : undeclared identifier

which happens at line 134 in the IntMemory.hx class

works when inlining is disabled with --no-inline
Sep 14, 2011
Project Member #1 gameh...@gmail.com
Hi,
Using haxelib polygonal (tried svn one too), svn haxe,  svn hxcpp it seems to compile on mac for me.  Are you using these versions?
Sep 26, 2011
#2 heinz.ho...@googlemail.com
Got the same problem, but also without inlining, try to compile this file:

package;


class Sample 
{
	
	public static function noInlineGetByte () {
		return flash.Memory.getByte(0);
	}
	
	public static function main()
	{
	}
}

I'm getting this error:

./src/Sample.cpp(42) : error C2065: '__global__' : undeclared identifier

where line 42 is the last line of noInlineGetByte

##################
int Sample_obj::noInlineGetByte( ){
	HX_SOURCE_PUSH("Sample_obj::noInlineGetByte")
	struct _Function_1_1{
		inline static int Block( Dynamic &__global__){
			HX_SOURCE_POS("src/Sample.hx",70)
			if ((((int)0 >= ::nme::Memory_obj::len))){
				HX_SOURCE_POS("src/Sample.hx",70)
				hx::Throw (HX_CSTRING("Bad address"));
			}
			HX_SOURCE_POS("src/Sample.hx",70)
			return ::__hxcpp_memory_get_byte((int)0);
		}
	};
	HX_SOURCE_POS("src/Sample.hx",69)
	return _Function_1_1::Block(__global__);
}
######################
Sep 26, 2011
#3 heinz.ho...@googlemail.com
flash is remapped to nme by the way
Oct 6, 2011
#4 michaelbaczynski@gmail.com
Heinz I can confirm this - it only works with --no-inline flag. Hugh can you please look at this? It's a showstopper right now ;)
Feb 8, 2012
Project Member #5 gameh...@gmail.com
Hi
This has been fixed by the patch.
Status: Fixed
Mar 1, 2012
#6 michaelbaczynski@gmail.com
Hey Hugh,
I still have this problem using latest haXe nighly, hxcpp 2.08.1 and nme 3.2.

This code:

class Main {
    static function main() {
        var x = flash.Memory.getI32(0);
    }
}

produces this error: Main.cpp(46) : error C2065: '__global__': non-declared identifier

generated code is:

HX_SOURCE_POS("src/Main.hx",2)
int x = _Function_1_1::Block(__global__);