Fix the interpretation of @#elseif clauses within an @#ifdef or @#ifndef

(cherry picked from commit 5d564eed)
6 jobs for 4.6 in 2 minutes and 53 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Build
passed #22513
build_linux_32

00:00:52

passed #22514
build_linux_64

00:01:44

passed #22517
macOS
build_macOS

00:02:16

passed #22515
build_windows_32

00:01:37

passed #22516
build_windows_64

00:01:57

 
  Prepare
passed #22518
aggregate_builds

00:00:04