Angelscript compile error on XCode

Started by
2 comments, last by Hatori 3 years ago

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;
}

Advertisement

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 - Tower - free puzzle game

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

This topic is closed to new replies.

Advertisement