Re: compiling PL/pgSQL plugin with C++
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Тарасов Георгий Витальевич <Tarasov-G@gaz-is.ru>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2019-05-30T15:54:24Z
Lists: pgsql-hackers, pgsql-general
[ redirecting to -hackers ] =?koi8-r?B?9MHSwdPP1yDnxc/Sx8nKIPfJ1MHM2MXXyd4=?= <Tarasov-G@gaz-is.ru> writes: > I'm working on development of some PL/pgSQL plugin. > The smaller part of my code is written on C. > It's a standard extension code for integration with fmgr (_PG_init ...) > But bigger part of the code is written on C++. > And here I need declarations of internal PL/pgSQL structs from plpgsql.h So ... that's supposed to work, because we have a test script that verifies that all our headers compile as C++. Or I thought it was "all", anyway. Closer inspection shows that it's not checking src/pl. Nor contrib. I propose that we change src/tools/pginclude/cpluspluscheck so that it searches basically everywhere: -for f in `find src/include src/interfaces/libpq/libpq-fe.h src/interfaces/libpq/libpq-events.h -name '*.h' -print | \ +for f in `find src contrib -name '*.h' -print | \ However, trying to run that, I find that plpython and plperl are both seriously in violation of the project convention that headers should compile standalone. It looks like most of their headers rely on an assumption that the calling .c file already included the Python or Perl headers respectively. Anybody object to me reshuffling the #include's to make this pass? I propose doing that for HEAD only, although we should back-patch George's fix (and any other actual C++ problems we find). regards, tom lane
Commits
-
Improve coverage of cpluspluscheck.
- 6f54b80edd88 12.0 landed
-
Fix C++ incompatibilities in ecpg/preproc/ header files.
- 4f67858d3f21 12.0 landed
-
Fix C++ incompatibilities in plpgsql's header files.
- db5d99916e80 9.4.23 landed
- da53e4f93fb3 9.5.18 landed
- c332c94adb70 9.6.14 landed
- 683c17b3071f 10.9 landed
- 3f61b3205f1a 12.0 landed
- 312017fcc46b 11.4 landed
-
Fix assorted header files that failed to compile standalone.
- 7640f9312321 12.0 landed
-
Make our perfect hash functions be valid C++.
- 9e58705a7f97 12.0 landed