Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6699729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:43:48+00:00 2026-05-26T06:43:48+00:00

I read that it is difficult to find out if an element is in

  • 0

I read that it is difficult to find out if an element is in an enumeration. So what would be the best way ?

For example, the following code comes from the Linux kernel 2.6.32:

enum v4l2_colorfx {
    V4L2_COLORFX_NONE    = 0,
    V4L2_COLORFX_BW      = 1,
    V4L2_COLORFX_SEPIA   = 2,
};

And this one from the 2.6.38 version:

enum v4l2_colorfx {
    V4L2_COLORFX_NONE        = 0,
    V4L2_COLORFX_BW          = 1,
    V4L2_COLORFX_SEPIA       = 2,
    V4L2_COLORFX_NEGATIVE    = 3,
    V4L2_COLORFX_EMBOSS      = 4,
    V4L2_COLORFX_SKETCH      = 5,
    V4L2_COLORFX_SKY_BLUE    = 6,
    V4L2_COLORFX_GRASS_GREEN = 7,
    V4L2_COLORFX_SKIN_WHITEN = 8,
    V4L2_COLORFX_VIVID       = 9,
};

How would you check if V4L2_COLORFX_NEGATIVE is defined ? Would #ifndef V4L2_COLORFX_NEGATIVE be okay ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:43:49+00:00Added an answer on May 26, 2026 at 6:43 am

    You would have to look at a compiler macro in the wider context (for example the version of linux, I don’t know what’s available) or some other piece of information at compile time. ifndef is for checking if compiler macros are defined, not symbols in code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out how to redirect output from some FORTRAN code for
I've read and heard from several people that WPF has a pretty steep learning
From Wikipedia, I read: Joux[3] noted that 2-collisions lead to n-collisions: if it is
I just found out, that it seems a common pattern to use UpperFirstLetterPascalCase() for
How do I best figure out if and where Apache is installed on a
I have a very difficult task, that I think exceeds my level of knowledge
Ok. So I have some code that maps certain controls on a winForm to
I want to be able to read from an unsorted source text file (one
I usually do not have difficulty to read JavaScript code but for this one
I read today that Django 1.3 alpha is shipping, and the most touted new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.