Skip to content
Snippets Groups Projects
Select Git revision
  • cf4d67e819e05d46836d896cce2a2b52f4a194d0
  • master default
  • benchmark-tools
  • postgres-lambda
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
24 results

cpluspluscheck

Blame
  • user avatar
    Peter Eisentraut authored
    It is not meant to be included standalone.
    cf4d67e8
    History
    cpluspluscheck 1.26 KiB
    #!/bin/sh
    
    # Check all exported PostgreSQL include files for C++ compatibility.
    # Run this from the top-level source directory after performing a build.
    # No output if everything is OK, else compiler errors.
    
    me=`basename $0`
    
    tmp=`mktemp -d /tmp/$me.XXXXXX`
    
    trap 'rm -rf $tmp' 0 1 2 3 15
    
    # Omit src/include/port/, because it's platform specific, and c.h includes
    # the relevant file anyway.
    # rusagestub.h is also platform-specific, and will be included by
    # utils/pg_rusage.h if necessary.
    # access/rmgrlist.h is not meant to be included standalone.
    # regex/regerrs.h is not meant to be included standalone.
    # parser/gram.h will be included by parser/gramparse.h.
    # parser/kwlist.h is not meant to be included standalone.
    
    for f in `find src/include src/interfaces/libpq/libpq-fe.h src/interfaces/libpq/libpq-events.h -name '*.h' -print | \
        grep -v -e ^src/include/port/ \
    	-e ^src/include/rusagestub.h -e ^src/include/regex/regerrs.h \
    	-e ^src/include/access/rmgrlist.h \
    	-e ^src/include/parser/gram.h -e ^src/include/parser/kwlist.h`
    do
    	{
    	    echo ' extern "C" {'
    	    test $f != "src/include/postgres_fe.h" && echo '#include "postgres.h"'
    	    echo "#include \"$f\""
    	    echo '};'
    	} >$tmp/test.cpp
    
    	${CXX:-g++} -I . -I src/include -fsyntax-only -Wall -c $tmp/test.cpp
    done