Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

inline_switch.h

Util code, that adds QoL change.

Usage

#include <stdio.h>
#include <inline_switch.h>

enum Values {
  VALUES_A,
  VALUES_B,
  VALUES_C,
};

int main() {
  enum values vals = VALUES_A;

  printf("value: %s",
    #define _INLINE_SWITCH_KEY vals
    INLINE_SWITCH(
      CASE(VALUES_A, "a")
      CASE(VALUES_B, "b")
      CASE(VALUES_C, "c")
    )
    #undef _INLINE_SWITCH_KEY
  );
  return 0;
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages