Sample code:
TestMod := MODULE, FORWARD EXPORT STRING TestFunction1(UNSIGNED1 n) := EMBED(C++) const char hexchar[] = "0123456789ABCDEF"; __lenResult = n; __result = static_cast<char*>(rtlMalloc(n)); memcpy(__result, hexchar, n); ENDEMBED; END; OUTPUT(TestMod.TestFunction1(5));
This code will fail syntax check:
campda01@ubuntu:~/Desktop_OSX/ECL/LexisNexis: eclcc -syntax Testing/BWR_Test2.ecl /media/psf/Home/Desktop/ECL/LexisNexis/Testing/BWR_Test2.ecl(3,37): error C2196: " is not legal string delimiter; use ' instead /media/psf/Home/Desktop/ECL/LexisNexis/Testing/BWR_Test2.ecl(3,56): error C2194: BEGINC++ or EMBED is not terminated /media/psf/Home/Desktop/ECL/LexisNexis/Testing/BWR_Test2.ecl(3,56): error C3002: syntax error : expected BEGINC++ /media/psf/Home/Desktop/ECL/LexisNexis/Testing/BWR_Test2.ecl(1,27): error C2100: Definition must contain EXPORT or SHARED value for TestFunction1 /media/psf/Home/Desktop/ECL/LexisNexis/Testing/BWR_Test2.ecl(11,29): error C3002: syntax error near "(" : expected ')' /media/psf/Home/Desktop/ECL/LexisNexis/Testing/BWR_Test2.ecl(11,30): error C3001: Too many errors (max = 5); Aborting...
Removing the FORWARD flag fixes this problem.