Skip to content

kritma/asic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Asic - easy async

Asic uses macros to generate async functions

asic() generates necessary functions. Put this in .c files

#define asic(func, return_type, args_types...)

asicDefinition() generates definitions for promise type, wait and async functions. Put this in .h files

#define asicDefinition(func, return_type, args_types...)
char *read_all_file(char *filename);

asicDefinition(read_all_file, char *, char *);

expands to

char *read_all_file(char *filename);

struct read_all_file_promise;
struct read_all_file_promise *read_all_file_async(char *);
char *read_all_file_promise_wait(struct read_all_file_promise *promise);

drawbacks

  • only gcc (because of use __builtin_apply_args, __builtin_apply)
  • max 1024 bytes for arguments or less (idk how to calc size of args_types)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages