Thread: macros: can i test if a function was defined?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2013
    Posts
    451

    macros: can i test if a function was defined?

    can i test if a function was defined for i see what function to use?
    if i call a not defined function, i will get 2 compilers errors. so for resolve the problem, i must use macros.
    i'm trying do some code but without success
    Code:
    #ifdef clsPointer->MouseClick            
                     clsPointer->MouseClick();
            #else
                MouseClick();
            #endif
    these code isn't completed, but for show what i mean.
    if i define the clsPointer->MouseClick, the compiler must use the clsPointer->MouseClick, but if sin't, the compiler must use MouseClick.
    so what i miss on these code?
    Last edited by joaquim; 04-29-2018 at 09:01 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 35
    Last Post: 12-01-2011, 08:31 PM
  2. Using switch statements in function-like macros
    By robot_chicken in forum C Programming
    Replies: 3
    Last Post: 07-25-2009, 03:09 PM
  3. function definition with macros
    By toshog in forum C++ Programming
    Replies: 2
    Last Post: 03-08-2009, 09:22 PM
  4. using functions and macros defined in include/linux/list.h
    By smoking81 in forum Linux Programming
    Replies: 2
    Last Post: 09-27-2008, 04:32 AM
  5. Replies: 14
    Last Post: 03-02-2008, 01:27 PM

Tags for this Thread