diff --git a/lib/7.0/modules/Simulate.pmod b/lib/7.0/modules/Simulate.pmod index 8dffae0910cde58567bb6f0433c29775d6f7911e..b24d6ab899d0d718267ff33f6e6eaa048f26844c 100644 --- a/lib/7.0/modules/Simulate.pmod +++ b/lib/7.0/modules/Simulate.pmod @@ -123,6 +123,6 @@ function l_sizeof = sizeof; function listp = multisetp; function mklist = mkmultiset; function aggregate_list = aggregate_multiset; -#if efun(gethostname) +#if constant(gethostname) function query_host_name=gethostname; #endif diff --git a/lib/7.2/modules/LR.pmod/lr.pike b/lib/7.2/modules/LR.pmod/lr.pike index 20b0d90637e41bc6b1961e18e82e982323aed6c5..9fe5d0a843476f14e73b6e92aa5304a87970d028 100755 --- a/lib/7.2/modules/LR.pmod/lr.pike +++ b/lib/7.2/modules/LR.pmod/lr.pike @@ -186,7 +186,7 @@ int main(int argc, array(string) argv) werror("Grammar:\n\n" + (string) g); -#if efun(_memory_usage) +#if constant(_memory_usage) werror(sprintf("Memory usage:\n%O\n", _memory_usage())); #endif @@ -198,7 +198,7 @@ int main(int argc, array(string) argv) werror("Compilation finished!\n"); -#if efun(_memory_usage) +#if constant(_memory_usage) werror(sprintf("Memory usage:\n%O\n", _memory_usage())); #endif diff --git a/lib/modules/Stdio.pmod/module.pmod b/lib/modules/Stdio.pmod/module.pmod index 2644f6eda8754899a0290e1a0c4067e6276dedae..8b0a62ced1cc90026e943bd1d4d2a065e320d6ad 100644 --- a/lib/modules/Stdio.pmod/module.pmod +++ b/lib/modules/Stdio.pmod/module.pmod @@ -2589,7 +2589,7 @@ string simplify_path(string path) //! void perror(string s) { -#if efun(strerror) +#if constant(strerror) stderr->write(s+": "+strerror(predef::errno())+"\n"); #else stderr->write(s+": errno: "+predef::errno()+"\n"); diff --git a/lib/modules/Tools.pmod/Install.pmod b/lib/modules/Tools.pmod/Install.pmod index 21270a1a8869a0bd67789341cbe4d23dfbcaa002..32db9c4cf72fcd81acf756d35326755c941921e3 100644 --- a/lib/modules/Tools.pmod/Install.pmod +++ b/lib/modules/Tools.pmod/Install.pmod @@ -27,7 +27,7 @@ array(string) features() a += ({ "dynamic_modules" }); #endif -#if efun(thread_create) +#if constant(thread_create) a += ({ "threads" }); #endif diff --git a/src/modules/HTTPLoop/test.pike b/src/modules/HTTPLoop/test.pike index 28584148a25bbfd5f70a120373b218f060501c27..7dd6ed77f0a14f4ca2c45242f432bdef81fae3f6 100644 --- a/src/modules/HTTPLoop/test.pike +++ b/src/modules/HTTPLoop/test.pike @@ -84,7 +84,7 @@ int main(int argc, array argv) } }, t); -#if efun(thread_set_concurrency) +#if constant(thread_set_concurrency) thread_set_concurrency(10); #endif port = files.port(); diff --git a/src/modules/HTTPLoop/wwwserver.pike b/src/modules/HTTPLoop/wwwserver.pike index 944ad1bef0d69c00bb45ec5b98ca7ac2a3233159..3c7ae707fc4c87dbc1d2ce46310c34284c350caf 100644 --- a/src/modules/HTTPLoop/wwwserver.pike +++ b/src/modules/HTTPLoop/wwwserver.pike @@ -151,7 +151,7 @@ object l; int main(int argc, array (string) argv) { -#if efun(thread_set_concurrency) +#if constant(thread_set_concurrency) thread_set_concurrency(100); #endif port = Stdio.Port(); diff --git a/src/modules/_Stdio/socktest.pike b/src/modules/_Stdio/socktest.pike index de901a2213e4c026dbf5fe74080a91ed993682de..8af4bfeb5f580850bd239cdc383dac3d03f01e56 100755 --- a/src/modules/_Stdio/socktest.pike +++ b/src/modules/_Stdio/socktest.pike @@ -6,7 +6,7 @@ // FIXME: Ought to test all the available backends. -#if !efun(strerror) +#if !constant(strerror) #define strerror(X) ("ERRNO = "+(string)(X)) #endif diff --git a/src/preprocessor.h b/src/preprocessor.h index 72f70a92adccf1c57243b2b821a4e95cd86f4e25..1aa195a42ec2b7621e77bb825a22ca7d5b5d3ce6 100644 --- a/src/preprocessor.h +++ b/src/preprocessor.h @@ -532,7 +532,7 @@ static ptrdiff_t calcC(struct cpp *this, WCHAR *data, ptrdiff_t len, SKIPWHITE(); - if ( (func_name==efun_str || func_name==constant_str) && + if ( (func_name==constant_str || func_name==efun_str) && data[pos] == '(') { int start, end; diff --git a/src/testsuite.in b/src/testsuite.in index e7a65e8d287250e2aa138074b1c451fbc52e74f2..d368294301aedd6c01672ccb48de72765438adcc 100644 --- a/src/testsuite.in +++ b/src/testsuite.in @@ -5,6 +5,8 @@ test_compile_any([[#pike 7.2]]) test_compile_any([[#pike 7.4]]) test_compile_any([[#pike 7.0]]) test_compile_any([[#pike 0.6]]) +test_compile_any([[#pike 7.6]]) +test_compile_any([[#pike 7.8]]) cond([[all_constants()->_verify_internals]], [[ @@ -10271,6 +10273,14 @@ do_test_foop(programp,8) // add_constant test_do(add_constant("foobar",lambda() { return 1; })) test_any([[ +#if constant(foobar) +return 1; +#else +return 0; +#endif +]],1) +test_any([[ +#pike 7.8 #if efun(foobar) return 1; #else @@ -10280,7 +10290,7 @@ return 0; test_eq(foobar(),1) test_do(add_constant("foobar")) test_any([[ -#if efun(foobar) +#if constant(foobar) return 1; #else return 0;