Like Tree2Likes
  • 1 Post By Salem
  • 1 Post By grumpy

typedef problem vs c++

This is a discussion on typedef problem vs c++ within the C++ Programming forums, part of the General Programming Boards category; xxx.h has #define EXTERNAL WINAPI #define RFAR far ..... ....... yy.h has #include xxx.h typedef unsigned short RDM_SESS ..... ....... ...

  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    1

    typedef problem vs c++

    xxx.h has
    #define EXTERNAL WINAPI
    #define RFAR far
    .....
    .......
    yy.h has
    #include xxx.h

    typedef unsigned short RDM_SESS
    .....
    .......
    typedef void(EXTERNAL *ERRORPROC)(short,RDM_SESS,void RFAR*);

    this last line is causing compile errors ( vs 2010) like RFAR illegal use of type void

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    Don't use uppercase names for anything other than macro names.

    Then you won't get caught out by having symbols you use (which aren't macros) being randomly replaced because someone chooses to define something like RFAR.
    King Mir likes this.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,208
    The issue of name clashes with macros aside, I suspect the problem is that modern compilers do not use or recognise far pointer types.
    King Mir likes this.
    Right 98% of the time, and don't care about the other 3%.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Typedef Problem
    By 8Aus9 in forum C Programming
    Replies: 3
    Last Post: 10-21-2010, 02:42 AM
  2. typedef problem
    By someprogr in forum C Programming
    Replies: 3
    Last Post: 01-25-2009, 04:46 AM
  3. Typedef problem
    By ToniShinobi in forum C Programming
    Replies: 11
    Last Post: 01-26-2008, 01:13 PM
  4. typedef problem
    By anarchypower in forum C Programming
    Replies: 8
    Last Post: 12-31-2006, 03:47 PM
  5. typedef problem
    By dr$brown in forum C Programming
    Replies: 6
    Last Post: 12-25-2004, 11:27 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21