Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

ccpp, a general purpose single-header preprocessor library.

License

NotificationsYou must be signed in to change notification settings

codecat/ccpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A general purpose single-header preprocessor library.

Supported directives

The following directives are currently supported:

  • #define <word>
  • #undef <word>
  • #if <condition>
  • #elif <condition>
  • #else
  • #endif
  • #include (viaset_include_callback)
  • Other arbitrary directives (viaset_command_callback)

Example usage:

staticchar*read_file(constchar* path,size_t* out_size) {/* ...*/ }intmain(){// Read contents of file "SomeFile.txt" into "buffer"size_t size;char* buffer =read_file("SomeFile.txt", &size);// Create a preprocessor  ccpp::processor p;// Add some definitions  p.add_define("SOME_DEFINE");// Begin processing  p.process(buffer, size);// Dump outputprintf("%s\n", buffer);return0;}

Motivation

I couldn't find a good simple no-dependencies preprocessor library for general purpose use that was also permissively licensed, so I decided to make my own.

This was made primarily as a preprocessor forOpenplanet's scripts.

License

MIT license.

About

ccpp, a general purpose single-header preprocessor library.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp