Thread: error using C macro

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    72

    error using C macro

    Hi all,

    I need some help with the following problem.

    I have a C macro defined like this:

    Code:
    #define AB_MAX_us_OP(_____ec)    (long)(AB_MAX_bits_AP(_____ec)*D_T_US)
    In my program, I am trying to use this macro to assign its value like this:

    Code:
    long find_window(void)
    {
        long window;
    
        window = AB_MAX_us_OP( APPLICATION_EC );
    
        return window;
    }
    but I receive the following error.

    error: expected identifier or ‘(’ before ‘long’
    #define AB_MAX_us_OP(_____ec) (long)(AB_MAX_bits_AP(_____ec)*D_T_US)
    ^


    I have used the same macro in another location but there I did not receive an error.

    thanks,

    zahid

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    The fact that you already used the macro somewhere else successfully means that there's something wrong with the code above this define.
    Devoted my life to programming...

  3. #3
    Registered User
    Join Date
    Sep 2017
    Posts
    1
    as @GReaper said,

    the error maybe in your AB_MAX_bits_AP macro

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking a macro's sign in order to define other macro
    By Egalestrenge in forum C Programming
    Replies: 5
    Last Post: 05-23-2016, 09:39 PM
  2. Macro Error for Driver Development
    By DougD720 in forum Windows Programming
    Replies: 2
    Last Post: 03-11-2011, 09:04 PM
  3. Compile error about MACRO
    By George2 in forum C Programming
    Replies: 1
    Last Post: 11-26-2007, 12:18 AM
  4. g++ error: Macro names must be identifiers.
    By eccles in forum C++ Programming
    Replies: 2
    Last Post: 01-15-2005, 03:28 AM
  5. Resolve error in Windows Macro?
    By Adock in forum C Programming
    Replies: 2
    Last Post: 03-19-2002, 08:41 PM

Tags for this Thread