Author Topic: My setup of CW compiler doesnt like the joining of two lines of "#define"  (Read 3146 times)

Offline thamanjd

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
after enabling the network indicator option in NE64 version of the project, the complier compained about this line:

    #define LINK_DOWN_LEDS()       PTL |= (LNKLED | ACTLED);       \
                                       PTL = ~(COLLED | SPDLED | DUPLED);


i assume the backslash somehow is supposed to indicated that the second line shoulds also be included in the define but my CW doesnt like it. Anybody know a way to make it work?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3068
    • View Profile
    • uTasker
Re: My setup of CW compiler doesnt like the joining of two lines of "#define"
« Reply #1 on: February 15, 2008, 11:37:38 AM »
Hi

Yes, the \ indicates that the following line should  be considered to be an extension of the first. This is used in a number of defines to avoid lines becoming too long.

For a fast solution simply declare the line as follows:
    #define LINK_DOWN_LEDS()       PTL |= (LNKLED | ACTLED); PTL = ~(COLLED | SPDLED | DUPLED);

If it still causes a problem it is not the \ but rather something else. But this will certainly remove the first possibility. At the moment I don't see why CW would have a problem with this so please tell us if it really solves it.

Regards

Mark

Offline thamanjd

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Ive now tested this in a second project and it seems ok. Not sure what i was doing that caused the error the first time.