#56 √ resolved
dissolve

conflict with sysmacros.h on gentoo linux

Reported by dissolve | August 4th, 2009 @ 11:43 PM | in 0.8.3

under gentoo linux, the macros in /usr/include/sys/sysmacros.h rewrite the minor() and major() functions as gnu_dev_minor() and gnu_dev_major.
easiest solution was to just change the naming of these function names to something else.

Comments and changes to this ticket

  • ayoy

    ayoy August 5th, 2009 @ 08:20 AM

    Hi, thanks for reporting. Do you mean the minor and major fields of AppVersion struct?

  • dissolve

    dissolve August 7th, 2009 @ 06:42 AM

    Sorry, yes. The problem is that the preprocessor doesn't seem to know the difference between a function call and the defaulted values on lines 30 and 31 of configfile.cpp
    Just moving those assignments inside the function fixes the problem too.

    Sorry, didn't look at it as closely before i just renamed the fields quickly, and I was lacking sleep.

    define commands from sysmacros.h

    / Access the functions with their traditional names. /

    define major(dev) gnu_dev_major (dev)

    define minor(dev) gnu_dev_minor (dev)

    I'm more curious why it really needs to pull in sysmacros.h at all. Seems silly that if anyone names a function minor or major they will get changed by it.

  • ayoy

    ayoy August 7th, 2009 @ 06:54 PM

    • → State changed from “new” to “resolved”
    • → Tag set to gentoo, sysmacros.h
    • → Milestone set to 0.8.3

    Fixed that issue in git:

    commit 3d9ad4dc2b7459aee7ac1077943904b5b54bf00c
    Author: Dominik Kapusta <d@ayoy.net>
    Date:   Fri Aug 7 17:57:01 2009 +0300
    
    Changed AppVersion::m{aj,in}or to AppVersion::m{aj,in}orVer in order to avoid ambiguity when including sysmacros.h - some configurations apparently need to use it (?)
    

    I have to say that I find it really strange, since I'm using Gentoo Linux and maintaining qTwitter there, and I didn't experience this issue (and I have sysmacros.h, I guess every system has it ;) ). And I'm not including sysmacros.h anywhere, also by quick greping through the Qt source code I don't find anything suspicious. Do you use architecture other than x86/amd64?

    Anyway, I'm about to tag and release the new version with minor changes, mainly due to QOAuth library being mostly feature-complete - which required reorganizing its internals and API a bit ;) Expect qTwitter 0.8.3 within hours in qting-edge overlay and tomorrow in portage I guess :)

  • dissolve

    dissolve August 8th, 2009 @ 06:32 AM

    Actually, I tried in on my home amd64 and an x86 running in my department, both had the same problem installing 0.8.2.
    It took a bit of searching but this looks like stdlib.h includes sys/types.h includes sys/sysmacros.h

    /usr/include/qt4/QtCore/qvector.h:#include <stdlib.h> /usr/include/qt4/Qt/qtestevent.h:#include <stdlib.h> /usr/include/qt4/Qt/qvector.h:#include <stdlib.h> /usr/include/qt4/QtTest/qtestevent.h:#include <stdlib.h>

    I tried tracing it through all of qt back up, but that got messy as hell.
    Curious though, why don't you get those inclusions. Different version of qt?

  • ayoy

    ayoy August 8th, 2009 @ 07:17 PM

    No idea, I've got Qt 4.5.2, the latest official. Anyway, qTwitter 0.8.3 with QOAuth 1.0 are in qting-edge now, and are joining Portage in a moment. Thanks for pointing out the issue!

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

qTwitter is a simple application interacting with twitter.com social network. Aimed to be as compact as possible, still providing the needed usability. It's being developed in Qt framework for C++.

People watching this ticket