Skip to main content
GameDev.net gamedev.net
🔒 Locked

Angelscript compile error on XCode

Started by Hatori Jun 1, 2021 at 8:08 PM 2 replies 4.6k views
Original Post
Hatori
Hatori

Hello, I have been trying to use version 2.35.0 of Angelscript in XCode version 12.4 and have been getting errors in as_module.cpp

I get the error Expected Expression when compiling. I have shown the code below with the lines causing the error. Any idea what this might be or a fix?

Thanks for any help!

Here are the errors:

// internal
void asCModule::AddClassType(asCObjectType* type)
{
	m_classTypes.PushLast(type);
	m_typeLookup.Insert({type->nameSpace, type->name}, type);  Expected Expression
}

// internal
void asCModule::AddEnumType(asCEnumType* type)
{
	m_enumTypes.PushLast(type);
	m_typeLookup.Insert({type->nameSpace, type->name}, type);   Expected Expression
}

// internal
void asCModule::AddTypeDef(asCTypedefType* type)
{
	m_typeDefs.PushLast(type);
	m_typeLookup.Insert({type->nameSpace, type->name}, type);    Expected Expression
}

// internal
void asCModule::AddFuncDef(asCFuncdefType* type)
{
	m_funcDefs.PushLast(type);
	m_typeLookup.Insert({type->nameSpace, type->name}, type);    Expected Expression
}

// internal
void asCModule::ReplaceFuncDef(asCFuncdefType* type, asCFuncdefType* newType)
{
	int i = m_funcDefs.IndexOf(type);
	if( i >= 0 )
	{
		m_funcDefs[i] = newType;
		
		// Replace it in the lookup map too
		asSMapNode<asSNameSpaceNamePair, asCTypeInfo*>* result = nullptr;
		if(m_typeLookup.MoveTo(&result, {type->nameSpace, type->name}))  Expected Expression
		{
			asASSERT( result->value == type );
			result->value = newType;
		}
	}
}

// internal
asCTypeInfo *asCModule::GetType(const asCString &type, asSNameSpace *ns) const
{
	asSMapNode<asSNameSpaceNamePair, asCTypeInfo*>* result = nullptr;
	if(m_typeLookup.MoveTo(&result, {ns, type}))    Expected Expression
	{
		return result->value;
	}
	return 0;
}

// internal
asCObjectType *asCModule::GetObjectType(const char *type, asSNameSpace *ns) const
{
	asSMapNode<asSNameSpaceNamePair, asCTypeInfo*>* result = nullptr;
	if(m_typeLookup.MoveTo(&result, {ns, type}))    Expected Expression
	{
		return CastToObjectType(result->value);
	}
 
	return 0;
}
WitchLord
WitchLord

These expressions use a later C++ standard. Most likely if you look in the xcode project settings you'll find an option to compile with a higher C++ standard that will work without further changes.

But, you can also use the code from the latest WIP version where I've already changed this code to be compatible with the older C++ standard.

Regards,

Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel
Hatori
Hatori

@WitchLord Thanks for the quick reply! I'll look into the WIP version!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.