Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/heimdal/cf/make-proto.pl

    r919 r988  
    33
    44use Getopt::Std;
    5 #require 'getopts.pl';
    65
    76my $comment = 0;
     
    1211my $oproto = 1;
    1312my $private_func_re = "^_";
     13my %depfunction = ();
    1414
    1515getopts('x:m:o:p:dqE:R:P:') || die "foo";
     
    2626    $private_func_re = $opt_R;
    2727}
    28 %flags = (
     28my %flags = (
    2929          'multiline-proto' => 1,
    3030          'header' => 1,
     
    101101        s/\s*$//;
    102102        s/\s+/ /g;
    103         if($_ =~ /\)$/ or $_ =~ /DEPRECATED$/){
     103        if($_ =~ /\)$/){
    104104            if(!/^static/ && !/^PRIVATE/){
    105105                $attr = "";
     
    108108                    $_ = $1;
    109109                }
    110                 if(m/(.*)\s(\w+DEPRECATED)/) {
     110                if(m/(.*)\s(\w+DEPRECATED_FUNCTION)\s?(\(.*\))(.*)/) {
     111                    $depfunction{$2} = 1;
     112                    $attr .= " $2$3";
     113                    $_ = "$1 $4";
     114                }
     115                if(m/(.*)\s(\w+DEPRECATED)(.*)/) {
    111116                    $attr .= " $2";
    112                     $_ = $1;
     117                    $_ = "$1 $3";
    113118                }
    114119                # remove outer ()
     
    303308    }
    304309}
     310
     311my $depstr = "";
     312my $undepstr = "";
     313foreach (keys %depfunction) {
     314    $depstr .= "#ifndef $_
     315#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 )))
     316#define $_(X) __attribute__((__deprecated__))
     317#else
     318#define $_(X)
     319#endif
     320#endif
     321
     322
     323";
     324    $public_h_trailer .= "#undef $_
     325
     326";
     327    $private_h_trailer .= "#undef $_
     328#define $_(X)
     329
     330";
     331}
     332
     333$public_h_header .= $depstr;
     334$private_h_header .= $depstr;
     335
     336
    305337if($flags{"cxx"}) {
    306338    $public_h_header .= "#ifdef __cplusplus
     
    309341
    310342";
    311     $public_h_trailer .= "#ifdef __cplusplus
    312 }
    313 #endif
    314 
    315 ";
     343    $public_h_trailer = "#ifdef __cplusplus
     344}
     345#endif
     346
     347" . $public_h_trailer;
    316348
    317349}
     
    349381}
    350382   
     383$public_h_trailer .= $undepstr;
     384$private_h_trailer .= $undepstr;
     385
    351386if ($public_h ne "" && $flags{"header"}) {
    352387    $public_h = $public_h_header . $public_h .
Note: See TracChangeset for help on using the changeset viewer.