Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile problem related to gettext on Linux #169

Closed
veripoolbot opened this issue Oct 23, 2009 · 3 comments
Closed

compile problem related to gettext on Linux #169

veripoolbot opened this issue Oct 23, 2009 · 3 comments
Assignees

Comments

@veripoolbot
Copy link
Collaborator


Author Name: Marek Rouchal
Original Redmine Issue: 169 from https://www.veripool.org
Original Date: 2009-10-23
Original Assignee: Wilson Snyder (@wsnyder)


When builing Verilog-Perl 3.220 on Linux (RedHat Enterprise Linux 3.0) with gcc-4.1.2, I saw this problem:

g++ -c -m32 -fno-strict-aliasing -pipe -I/opt/perl_5.8.8/ext/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I../Preproc -O2 -march=pentium4 -DVERSION="3.220" -DXS_VERSION="3.220" -fpic "-I/opt/perl_5.8.8/lib/CORE" VPreproc.cpp
VPreproc.cpp:126: error: expected identifier before '__null'
VPreproc.cpp:126: error: expected ',' or '...' before '__null'
VPreproc.cpp: In member function 'virtual std::string VPreproc::getline()':
VPreproc.cpp:164: error: no matching function for call to 'VPreprocImp::dcgettext(NULL, bool, )'

Seems that this is related to gettext(), which seems to be #define'd to something else on Linux - and the preprocessor garbles the VPreproc.cpp code. This rough patch corrects the problem and all tests run fine on Linux:

diff -ruN Verilog-Perl-3.220/Preproc/VPreproc.cpp Verilog-Perl-3.220p1/Preproc/VPreproc.cpp
--- Verilog-Perl-3.220/Preproc/VPreproc.cpp 2009-09-27 13:34:49.000000000 +0200
+++ Verilog-Perl-3.220p1/Preproc/VPreproc.cpp 2009-10-23 11:42:38.000000000 +0200
@@ -123,7 +123,7 @@
int getToken();
void parseTop();
void parseUndef();

  • string gettext(bool stop_at_eol);
  • string mYgettext(bool stop_at_eol);
    bool isEof() const { return (m_lexp==NULL); }
    void open(string filename, VFileLine* filelinep);
    void insertUnreadback(const string& text) { m_lineCmt += text; }
    @@ -161,11 +161,11 @@
    }
    string VPreproc::getline() {
    VPreprocImp* idatap = static_cast<VPreprocImp*>(m_opaquep);
  • return idatap->gettext(true);
  • return idatap->mYgettext(true);
    }
    string VPreproc::getall() {
    VPreprocImp* idatap = static_cast<VPreprocImp*>(m_opaquep);
  • return idatap->gettext(false);
  • return idatap->mYgettext(false);
    }
    void VPreproc::debug(int level) {
    VPreprocImp* idatap = static_cast<VPreprocImp*>(m_opaquep);
    @@ -871,7 +871,7 @@
    }
    }

-string VPreprocImp::gettext(bool stop_at_eol) {
+string VPreprocImp::mYgettext(bool stop_at_eol) {
// Get a single line from the parse stream. Buffer unreturned text until the newline.
if (isEof()) return "";
while (1) {

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Marek Rouchal
Original Date: 2009-10-23T12:23:26Z


Sorry - looks like the patch was garbled - I attach it again as a separate file.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2009-10-23T13:07:39Z


Thanks for the diagnosis & patch.

I've pushed a similar fix to git, it'll be in the next release.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2009-10-28T13:45:32Z


Fixed in 3.221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants