Thread: Macro style function

  1. #1
    Registered User
    Join Date
    Feb 2019
    Posts
    93

    Macro style function

    Hi,

    This macro style function:
    Code:
    #define nrf_queue_pop(_p_queue, _p_element) nrf_queue_generic_pop((_p_queue), (_p_element), false)
    is the same like this?

    Code:
    nrf_queue_pop(_p_queue, _p_element){
    nrf_queue_generic_pop((_p_queue), (_p_element), false)
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,154
    So long as only refers to each macro parameter once, it seems so.
    Question 10.1
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Feb 2019
    Posts
    93
    Thank you Salem!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. macro functions/efficiency tricks (old-style?)
    By jsaetrum in forum C Programming
    Replies: 8
    Last Post: 01-05-2012, 02:19 PM
  2. macro function
    By freeindy in forum C Programming
    Replies: 6
    Last Post: 11-08-2007, 05:04 AM
  3. Macro has same name as Function?
    By coolclu3 in forum C Programming
    Replies: 10
    Last Post: 09-28-2007, 04:55 AM
  4. macro function
    By bradleyd in forum C Programming
    Replies: 8
    Last Post: 05-21-2007, 05:18 PM
  5. reinterpret_cast, C-style cast or function-style cast
    By blight2c in forum C++ Programming
    Replies: 3
    Last Post: 05-14-2002, 10:07 PM

Tags for this Thread