8000 GitHub - robrix/RXPreprocessing: A variety of utilities for the C preprocessor.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 19, 2018. It is now read-only.

robrix/RXPreprocessing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RXPreprocessing

Metaprogramming and metapreprocessing utilities for the enterprising developer. Featuring old standbys and novelties alike, including:

  • good old token pasting — concat.h
  • variadic argument counting — count.h
  • differentiating between >=1- and 0-argument lists — count.h
  • boolean algebra, including NOT, OR, AND, and XOR — bool.h
  • conditional expressions — cond.h
  • left and right folds — fold.h
  • maps — map.h
  • arithmetic — math.h (incomplete)

Except where otherwise noted, these utilities are standard, cross-platform use of the C preprocessor, and do not rely on e.g. GNU extensions.

RXInterpolation.h

Preprocessor-based interpolation of NSStrings. This allows you to interpolate complex strings without requiring you to remember which format specifier you want for each. You can still, however, customize the formatting of each individual parameter to specify precision or width.

Requires Foundation, and uses __attribute__((overloadable)) functions to generate the type specifiers for the format strings, since clang’s support for C11’s _Generic expressions appears to have difficulty when both char * and default options are added.

Some things you can do with it:

NSUInteger waysILoveThee = kLotsOfWays;
RXLog(@"How do I love thee? Let me count the ways: ", waysILoveThee);

Inspired by @pgor, who nerd-sniped me one fine morning.

About

A variety of utilities for the C preprocessor.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  
0