obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

libobs/util: Add support for #if and #elif to CF parser

Open exeldro opened this issue 1 year ago • 0 comments

Description

Add support for #if and #elif to CF parser It supports without comparator and with the following comparators: ==, >=, <=, !=, <, >

Motivation and Context

This was not supported yet and I wanted to use it in a shader. And it helps when trying to convert existing shaders to be used in OBS.

How Has This Been Tested?

On windows 11 by having a shader with this code in it:

#define test 1234

#if test == 0

#elif 0

#elif test > 1234

#elif test < 1234

#elif test == 1234

#endif

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

exeldro avatar Mar 01 '24 07:03 exeldro