Issue #169
compile problem related to gettext on Linux
| Status: | Closed | Start date: | 10/23/2009 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | Wilson Snyder | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - |
Description
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, <anonymous enum>)'
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) {
History
Updated by Marek Rouchal over 3 years ago
- File Verilog-Perl.diff added
Sorry - looks like the patch was garbled - I attach it again as a separate file.
Updated by Wilson Snyder over 3 years ago
- Status changed from New to Resolved
- Assignee set to Wilson Snyder
Thanks for the diagnosis & patch.
I've pushed a similar fix to git, it'll be in the next release.
Also available in: Atom
![[logo]](/img/veripool_small.png)