Results 1 to 3 of 3

Thread: slice2cpp -U to undef min and max macros

  1. #1
    StuartA is offline Registered User
    Join Date
    Feb 2004
    Location
    Canberra Australia
    Posts
    23

    slice2cpp -U to undef min and max macros

    I have a slice struct which contains members min and max. This works fine
    with gcc. When I use a MSVC compiler it complains about not enough
    actual parameters for macro min. Oops, forgot that MSVC has legacy
    macros for min and max.

    Solution, undef min and max. However this has to be done by the
    slice2cpp program. I noticed there is a -U argument to slice2cpp
    which would solve the problem. However I can't seem to get it
    generate the undef statements (tried both `-Umin' and `-U min').

    I had a bit of a look through
    src/slice2cpp/Gen.cpp
    src/Slice/Preprocessor.cpp
    but couldn't find where it output the undef statements.

    I thought it would be around line 253 of Gen.cpp (3.0.1). After:-

    H << "\n#include <Ice/UndefSysMacros.h>";


    Regards

    Stuart
    Stuart Argue

    University Of Wollongong, Australia (Eng/CS Student)
    http://www.uow.edu.au

    Project: Savvi: Student Assessment Viewer and Voluntry Interaction
    - Advanced WebCT replacement
    - Native GUI and HTML interfaces

    Development Platform: Debian/GNU, g++, scons, boost, Qt
    Target: Services: Unix; clients: Win, MacOS, Linux

    Status: pre-Alpha
    Development cycle: spare time
    Chance of going commercial: yes (late 2006)

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Have you considered editing Ice/UndefSysMacros.h to undefine min and max?

    Cheers,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  3. #3
    StuartA is offline Registered User
    Join Date
    Feb 2004
    Location
    Canberra Australia
    Posts
    23
    Thanks Bernard,

    Good solution.

    I just ended up renaming min to minVal etc. Not a big change.

    Got a bit sidetracked on why -U wouldn't work.

    Thanks

    Stuart
    Stuart Argue

    University Of Wollongong, Australia (Eng/CS Student)
    http://www.uow.edu.au

    Project: Savvi: Student Assessment Viewer and Voluntry Interaction
    - Advanced WebCT replacement
    - Native GUI and HTML interfaces

    Development Platform: Debian/GNU, g++, scons, boost, Qt
    Target: Services: Unix; clients: Win, MacOS, Linux

    Status: pre-Alpha
    Development cycle: spare time
    Chance of going commercial: yes (late 2006)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. std::max issue on Debian
    By g00fy in forum Bug Reports
    Replies: 1
    Last Post: 06-15-2008, 12:59 PM
  2. ways to get the max&min value of a Freeze map index?
    By peterlspot in forum Help Center
    Replies: 1
    Last Post: 01-08-2008, 07:14 AM
  3. Replies: 0
    Last Post: 11-06-2006, 08:35 AM
  4. icestorm max clients
    By diddek in forum Help Center
    Replies: 1
    Last Post: 10-18-2004, 04:45 PM
  5. ICE/win32 max connections is 64!!
    By kssreeram in forum Help Center
    Replies: 1
    Last Post: 11-03-2003, 07:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •