Hi Team, I am porting m4 to z/OS and came across following compilation error related to gnulib:
glthread/thread.c:206:1: error: unknown type name 'gl_thread_t'; did you mean
'pthread_t'?
gl_thread_t
^~~~~~~~~~~
pthread_t
/usr/include/le/sys/types.h:288:13: note: 'pthread_t' declared here
} pthread_t;
^
glthread/thread.c:209:3: error: unknown type name 'gl_thread_t'; did you mean
'pthread_t'?
gl_thread_t thread;
^~~~~~~~~~~
pthread_t
/usr/include/le/sys/types.h:288:13: note: 'pthread_t' declared here
} pthread_t;
^
glthread/thread.c:212:9: warning: implicit declaration of function
'glthread_create' is invalid in C99 [-Wimplicit-function-declaration]
ret = glthread_create (&thread, func, arg);
The compile command used is:
source='glthread/thread.c' object='glthread/thread.o' libtool=no \
DEPDIR=.deps depmode=hp2 /bin/sh ../build-aux/depcomp \
xlclang -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../lib -DIN_M4_GNULIB_TESTS=1 -I.
-I. -I.. -I./.. -I../lib -I./../lib -DNSIG=42 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE
-D_OPEN_SYS_FILE_EXT=1 -D_AE_BIMODAL=1 -D_ENHANCED_ASCII_EXT=0xFFFFFFFF
-qascii -std=gnu11 -qnocsect -qenum=int -qgonumber -O3 -qnose -std=c11
-fgnu89-inline
-I/home/haritha/code/m4port/m4/lib,/home/haritha/code/m4port/patches/PR1/include,/usr/include/le
-c -o glthread/thread.o glthread/thread.c
The above error got fixed when I moved the below code under #if USE_ISOC_THREADS
gl_thread_t
gl_thread_create (void *(*func) (void *arg), void *arg)
{
gl_thread_t thread;
int ret;
ret = glthread_create (&thread, func, arg);
if (ret != 0)
abort ();
return thread;
}
I have attached the file with git diff for reference: thread.c.patch
I would like to upstream these changes. Please let me know if you have any
concerns or questions.
Regards
Haritha
thread.c.patch
Description: thread.c.patch
