gotranspile / cxgo

Tool for transpiling C to Go.
https://gotranspile.dev
MIT License
328 stars 22 forks source link

Extract headers from go sources to h files #69

Closed g41797 closed 1 year ago

g41797 commented 1 year ago

Separated include files were created in libs folder: arpa_inet.h glob.h netdb.h pthread.h setjmp.h stdarg.h stdlib.h string.h sys_socket.h sys_stat.h sys_time.h sys_types.h time.h unistd.h wctype.h

Content of every include file above was extracted from corresponding go source file.

Read of includes was implemented via "embed" pkg

g41797 commented 1 year ago

We can move these *.h file to includes directory and move already existing files (created in prev. PR) to new includes/embed dir Pros:

What do you think?

dennwc commented 1 year ago

Sounds good :+1:

g41797 commented 1 year ago

tomorrow i'll try to fix

g41797 commented 1 year ago

fixed how to proceed?

dennwc commented 1 year ago

I added a new function RegisterLibrarySrc which is used in auto-registration from include directory. It is then automatically joined with everything registered via RegisterLibrary. So no need for a special embed directory. Should work a bit better now :+1: