trealla-prolog / trealla

A compact, efficient Prolog interpreter written in plain-old C.
MIT License
268 stars 13 forks source link

Commit b0f5958 missed removing ifdefs in file internal.h #507

Closed flexoron closed 6 months ago

flexoron commented 6 months ago
src/internal.h:

   20: #if USE_THREADS
   21: #ifdef _WIN32    // should/must be removed, see issue #506
       : 
  649: #if USE_THREADS
  650: #ifdef _WIN32
       : 

Background:
Pthreads: Type pthread_t / HANDLE ... Linux / Windows incompatibility.
Modern Posix pthreads implementation eliminates this (Windows) issue.
(Domain of research: unsigned long int pthread_t vs. struct pthread_t)
(Digging it out deeper: Setting bits vs. Additional struct fields).
flexoron commented 6 months ago

I forgot to mention two harmless warnings:

clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-pthread' [-Wunused-command-line-argument]

caused by Makefile:60: CFLAGS += -DUSE_THREADS=1 -pthread Makefile:61: LDFLAGS += -pthreads

should be Makefile:60: CFLAGS += -DUSE_THREADS=1 Makefile:61: LDFLAGS += -lpthreads

Alright, it is a (msys2-)clang warning so ignore this report.

Excellent! Windows Pthreads available! Thanks!