File: dirent.py

package info (click to toggle)
fsplib 0.14-5.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 236 kB
  • sloc: ansic: 1,581; python: 117; makefile: 11; sh: 8
file content (31 lines) | stat: -rw-r--r-- 674 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#
# SCons check for dirent member
#
# Version 1.0
# 9-Sep-2014
#

def checkForDirentMember(conf,member,symbol):
    """Checks if dirent structure has specified field member.
 
    Keyword arguments:
    member -- what member we are checking
    symbol -- symbol to be defined by preprocessor if member exists

    """
    conf.Message("checking whether dirent structure has member "+member+"... ")
    rc=conf.TryCompile("""
    #include <sys/types.h>
    #include <dirent.h>

    void dummy(void);
    void dummy()
    {
	struct dirent d;
	d."""+member+"""=0;
    }
    """,".c")
    if rc:
        conf.env.Append(CPPFLAGS = '-D'+symbol)
    conf.Result(rc)
    return rc