~ubuntu-branches/ubuntu/quantal/psi/quantal

« back to all changes in this revision

Viewing changes to qcm/ghbnr.qcm

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
class qc_ghbnr : public ConfObj
7
7
{
8
8
public:
9
 
        qc_ghbnr(Conf *c) : ConfObj(c)
10
 
        {
11
 
        }
12
 
 
13
 
        ~qc_ghbnr()
14
 
        {
15
 
                remove("ftest.c");
16
 
                remove("ftest");
17
 
        }
 
9
        qc_ghbnr(Conf *c) : ConfObj(c) { }
18
10
 
19
11
        QString name() const { return "gethostbyname_r()"; }
20
12
        QString shortname() const { return "ghbnr"; }
21
13
 
22
14
        bool exec()
23
15
        {
24
 
                char *fdata =
 
16
                QString str =
25
17
                        "#include<netdb.h>\n"
26
18
                        "\n"
27
19
                        "int main()\n"
29
21
                        "    gethostbyname_r(\"\", 0, 0, 0, 0, 0);\n"
30
22
                        "    return 0;\n"
31
23
                        "}\n";
32
 
 
33
 
                FILE *f;
34
 
                f = fopen("ftest.c", "w");      
35
 
                if(!f)
36
 
                        return false;
37
 
                fwrite(fdata, strlen(fdata), 1, f);
38
 
                fclose(f);
39
 
 
40
 
                QString str = conf->qvar("QMAKE_CC") + " ftest.c -o ftest";
41
 
                int r = conf->doCommand(str);
42
 
                if(r == 0) {
43
 
                        conf->addDefine("HAVE_GETHOSTBYNAME_R");
44
 
                        return true;
45
 
                }
46
 
                else
47
 
                        return false;
 
24
                if (!conf->doCompileAndLink(str, QStringList(), QString(), QString(), NULL))
 
25
                        return false;
 
26
                        
 
27
                conf->addDefine("HAVE_GETHOSTBYNAME_R");
 
28
                return true;
48
29
        }
49
30
};