~ubuntu-branches/ubuntu/trusty/libidn/trusty

« back to all changes in this revision

Viewing changes to gltests/sys_stat.in.h

  • Committer: Bazaar Package Importer
  • Author(s): Simon Josefsson
  • Date: 2011-03-01 16:14:24 UTC
  • mfrom: (1.2.14 upstream) (3.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110301161424-6vh7822t8aderzap
Tags: 1.20-1
* New upstream release.
* Moved from experimental to unstable after testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Provide a more complete sys/stat header file.
2
 
   Copyright (C) 2005-2010 Free Software Foundation, Inc.
 
2
   Copyright (C) 2005-2011 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software; you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
24
24
#if __GNUC__ >= 3
25
25
@PRAGMA_SYSTEM_HEADER@
26
26
#endif
 
27
@PRAGMA_COLUMNS@
27
28
 
28
29
#if defined __need_system_sys_stat_h
29
30
/* Special invocation convention.  */
47
48
#ifndef _GL_SYS_STAT_H
48
49
#define _GL_SYS_STAT_H
49
50
 
 
51
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
52
 
50
53
/* The definition of _GL_ARG_NONNULL is copied here.  */
51
54
 
52
55
/* The definition of _GL_WARN_ON_USE is copied here.  */
54
57
/* Before doing "#define mkdir rpl_mkdir" below, we need to include all
55
58
   headers that may declare mkdir().  */
56
59
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
57
 
# include <io.h>
 
60
# include <io.h>     /* mingw32, mingw64 */
 
61
# include <direct.h> /* mingw64 */
58
62
#endif
59
63
 
60
64
#ifndef S_IFMT
290
294
#endif
291
295
 
292
296
 
293
 
#ifdef __cplusplus
294
 
extern "C" {
295
 
#endif
296
 
 
297
 
 
298
297
#if @GNULIB_FCHMODAT@
299
298
# if !@HAVE_FCHMODAT@
300
 
extern int fchmodat (int fd, char const *file, mode_t mode, int flag)
301
 
     _GL_ARG_NONNULL ((2));
 
299
_GL_FUNCDECL_SYS (fchmodat, int,
 
300
                  (int fd, char const *file, mode_t mode, int flag)
 
301
                  _GL_ARG_NONNULL ((2)));
302
302
# endif
 
303
_GL_CXXALIAS_SYS (fchmodat, int,
 
304
                  (int fd, char const *file, mode_t mode, int flag));
 
305
_GL_CXXALIASWARN (fchmodat);
303
306
#elif defined GNULIB_POSIXCHECK
304
307
# undef fchmodat
305
308
# if HAVE_RAW_DECL_FCHMODAT
310
313
 
311
314
 
312
315
#if @REPLACE_FSTAT@
313
 
# define fstat rpl_fstat
314
 
extern int fstat (int fd, struct stat *buf) _GL_ARG_NONNULL ((2));
 
316
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
317
#  define fstat rpl_fstat
 
318
# endif
 
319
_GL_FUNCDECL_RPL (fstat, int, (int fd, struct stat *buf) _GL_ARG_NONNULL ((2)));
 
320
_GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
 
321
#else
 
322
_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
315
323
#endif
 
324
_GL_CXXALIASWARN (fstat);
316
325
 
317
326
 
318
327
#if @GNULIB_FSTATAT@
319
328
# if @REPLACE_FSTATAT@
320
 
#  undef fstatat
321
 
#  define fstatat rpl_fstatat
322
 
# endif
323
 
# if !@HAVE_FSTATAT@ || @REPLACE_FSTATAT@
324
 
extern int fstatat (int fd, char const *name, struct stat *st, int flags)
325
 
     _GL_ARG_NONNULL ((2, 3));
326
 
# endif
 
329
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
330
#   undef fstatat
 
331
#   define fstatat rpl_fstatat
 
332
#  endif
 
333
_GL_FUNCDECL_RPL (fstatat, int,
 
334
                  (int fd, char const *name, struct stat *st, int flags)
 
335
                  _GL_ARG_NONNULL ((2, 3)));
 
336
_GL_CXXALIAS_RPL (fstatat, int,
 
337
                  (int fd, char const *name, struct stat *st, int flags));
 
338
# else
 
339
#  if !@HAVE_FSTATAT@
 
340
_GL_FUNCDECL_SYS (fstatat, int,
 
341
                  (int fd, char const *name, struct stat *st, int flags)
 
342
                  _GL_ARG_NONNULL ((2, 3)));
 
343
#  endif
 
344
_GL_CXXALIAS_SYS (fstatat, int,
 
345
                  (int fd, char const *name, struct stat *st, int flags));
 
346
# endif
 
347
_GL_CXXALIASWARN (fstatat);
327
348
#elif defined GNULIB_POSIXCHECK
328
349
# undef fstatat
329
350
# if HAVE_RAW_DECL_FSTATAT
335
356
 
336
357
#if @GNULIB_FUTIMENS@
337
358
# if @REPLACE_FUTIMENS@
338
 
#  undef futimens
339
 
#  define futimens rpl_futimens
340
 
# endif
341
 
# if !@HAVE_FUTIMENS@ || @REPLACE_FUTIMENS@
342
 
extern int futimens (int fd, struct timespec const times[2]);
343
 
# endif
 
359
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
360
#   undef futimens
 
361
#   define futimens rpl_futimens
 
362
#  endif
 
363
_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]));
 
364
_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2]));
 
365
# else
 
366
#  if !@HAVE_FUTIMENS@
 
367
_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
 
368
#  endif
 
369
_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
 
370
# endif
 
371
_GL_CXXALIASWARN (futimens);
344
372
#elif defined GNULIB_POSIXCHECK
345
373
# undef futimens
346
374
# if HAVE_RAW_DECL_FUTIMENS
361
389
   invocation of lchmod, but we know of no workarounds that are
362
390
   reliable in general.  You might try requesting support for lchmod
363
391
   from your operating system supplier.  */
364
 
#  define lchmod chmod
 
392
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
393
#   define lchmod chmod
 
394
#  endif
 
395
/* Need to cast, because on mingw, the second parameter of chmod is
 
396
                                                int mode.  */
 
397
_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int,
 
398
                         (const char *filename, mode_t mode));
 
399
# else
 
400
#  if 0 /* assume already declared */
 
401
_GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
 
402
                               _GL_ARG_NONNULL ((1)));
 
403
#  endif
 
404
_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
365
405
# endif
366
 
# if 0 /* assume already declared */
367
 
extern int lchmod (const char *filename, mode_t mode) _GL_ARG_NONNULL ((1));
 
406
# if @HAVE_LCHMOD@
 
407
_GL_CXXALIASWARN (lchmod);
368
408
# endif
369
409
#elif defined GNULIB_POSIXCHECK
370
410
# undef lchmod
379
419
# if ! @HAVE_LSTAT@
380
420
/* mingw does not support symlinks, therefore it does not have lstat.  But
381
421
   without links, stat does just fine.  */
382
 
#  define lstat stat
 
422
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
423
#   define lstat stat
 
424
#  endif
 
425
_GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf));
383
426
# elif @REPLACE_LSTAT@
384
 
#  undef lstat
385
 
#  define lstat rpl_lstat
386
 
extern int rpl_lstat (const char *name, struct stat *buf)
387
 
     _GL_ARG_NONNULL ((1, 2));
 
427
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
428
#   undef lstat
 
429
#   define lstat rpl_lstat
 
430
#  endif
 
431
_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf)
 
432
                              _GL_ARG_NONNULL ((1, 2)));
 
433
_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf));
 
434
# else
 
435
_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf));
 
436
# endif
 
437
# if @HAVE_LSTAT@
 
438
_GL_CXXALIASWARN (lstat);
388
439
# endif
389
440
#elif defined GNULIB_POSIXCHECK
390
441
# undef lstat
396
447
 
397
448
 
398
449
#if @REPLACE_MKDIR@
399
 
# undef mkdir
400
 
# define mkdir rpl_mkdir
401
 
extern int mkdir (char const *name, mode_t mode) _GL_ARG_NONNULL ((1));
 
450
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
451
#  undef mkdir
 
452
#  define mkdir rpl_mkdir
 
453
# endif
 
454
_GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
 
455
                              _GL_ARG_NONNULL ((1)));
 
456
_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
402
457
#else
403
458
/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
404
459
   Additionally, it declares _mkdir (and depending on compile flags, an
405
 
   alias mkdir), only in the nonstandard <io.h>, which is included above.  */
 
460
   alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
 
461
   which are included above.  */
406
462
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
407
463
 
 
464
#  if !GNULIB_defined_rpl_mkdir
408
465
static inline int
409
466
rpl_mkdir (char const *name, mode_t mode)
410
467
{
411
468
  return _mkdir (name);
412
469
}
 
470
#   define GNULIB_defined_rpl_mkdir 1
 
471
#  endif
413
472
 
414
 
#  define mkdir rpl_mkdir
 
473
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
474
#   define mkdir rpl_mkdir
 
475
#  endif
 
476
_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
 
477
# else
 
478
_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
415
479
# endif
416
480
#endif
 
481
_GL_CXXALIASWARN (mkdir);
417
482
 
418
483
 
419
484
#if @GNULIB_MKDIRAT@
420
485
# if !@HAVE_MKDIRAT@
421
 
extern int mkdirat (int fd, char const *file, mode_t mode)
422
 
     _GL_ARG_NONNULL ((2));
 
486
_GL_FUNCDECL_SYS (mkdirat, int, (int fd, char const *file, mode_t mode)
 
487
                                _GL_ARG_NONNULL ((2)));
423
488
# endif
 
489
_GL_CXXALIAS_SYS (mkdirat, int, (int fd, char const *file, mode_t mode));
 
490
_GL_CXXALIASWARN (mkdirat);
424
491
#elif defined GNULIB_POSIXCHECK
425
492
# undef mkdirat
426
493
# if HAVE_RAW_DECL_MKDIRAT
432
499
 
433
500
#if @GNULIB_MKFIFO@
434
501
# if @REPLACE_MKFIFO@
435
 
#  undef mkfifo
436
 
#  define mkfifo rpl_mkfifo
437
 
# endif
438
 
# if !@HAVE_MKFIFO@ || @REPLACE_MKFIFO@
439
 
extern int mkfifo (char const *file, mode_t mode) _GL_ARG_NONNULL ((1));
440
 
# endif
 
502
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
503
#   undef mkfifo
 
504
#   define mkfifo rpl_mkfifo
 
505
#  endif
 
506
_GL_FUNCDECL_RPL (mkfifo, int, (char const *file, mode_t mode)
 
507
                               _GL_ARG_NONNULL ((1)));
 
508
_GL_CXXALIAS_RPL (mkfifo, int, (char const *file, mode_t mode));
 
509
# else
 
510
#  if !@HAVE_MKFIFO@
 
511
_GL_FUNCDECL_SYS (mkfifo, int, (char const *file, mode_t mode)
 
512
                               _GL_ARG_NONNULL ((1)));
 
513
#  endif
 
514
_GL_CXXALIAS_SYS (mkfifo, int, (char const *file, mode_t mode));
 
515
# endif
 
516
_GL_CXXALIASWARN (mkfifo);
441
517
#elif defined GNULIB_POSIXCHECK
442
518
# undef mkfifo
443
519
# if HAVE_RAW_DECL_MKFIFO
449
525
 
450
526
#if @GNULIB_MKFIFOAT@
451
527
# if !@HAVE_MKFIFOAT@
452
 
extern int mkfifoat (int fd, char const *file, mode_t mode)
453
 
     _GL_ARG_NONNULL ((2));
 
528
_GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
 
529
                                 _GL_ARG_NONNULL ((2)));
454
530
# endif
 
531
_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
 
532
_GL_CXXALIASWARN (mkfifoat);
455
533
#elif defined GNULIB_POSIXCHECK
456
534
# undef mkfifoat
457
535
# if HAVE_RAW_DECL_MKFIFOAT
463
541
 
464
542
#if @GNULIB_MKNOD@
465
543
# if @REPLACE_MKNOD@
466
 
#  undef mknod
467
 
#  define mknod rpl_mknod
468
 
# endif
469
 
# if !@HAVE_MKNOD@ || @REPLACE_MKNOD@
470
 
extern int mknod (char const *file, mode_t mode, dev_t dev)
471
 
     _GL_ARG_NONNULL ((1));
472
 
# endif
 
544
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
545
#   undef mknod
 
546
#   define mknod rpl_mknod
 
547
#  endif
 
548
_GL_FUNCDECL_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev)
 
549
                              _GL_ARG_NONNULL ((1)));
 
550
_GL_CXXALIAS_RPL (mknod, int, (char const *file, mode_t mode, dev_t dev));
 
551
# else
 
552
#  if !@HAVE_MKNOD@
 
553
_GL_FUNCDECL_SYS (mknod, int, (char const *file, mode_t mode, dev_t dev)
 
554
                              _GL_ARG_NONNULL ((1)));
 
555
#  endif
 
556
/* Need to cast, because on OSF/1 5.1, the third parameter is '...'.  */
 
557
_GL_CXXALIAS_SYS_CAST (mknod, int, (char const *file, mode_t mode, dev_t dev));
 
558
# endif
 
559
_GL_CXXALIASWARN (mknod);
473
560
#elif defined GNULIB_POSIXCHECK
474
561
# undef mknod
475
562
# if HAVE_RAW_DECL_MKNOD
481
568
 
482
569
#if @GNULIB_MKNODAT@
483
570
# if !@HAVE_MKNODAT@
484
 
extern int mknodat (int fd, char const *file, mode_t mode, dev_t dev)
485
 
     _GL_ARG_NONNULL ((2));
 
571
_GL_FUNCDECL_SYS (mknodat, int,
 
572
                  (int fd, char const *file, mode_t mode, dev_t dev)
 
573
                  _GL_ARG_NONNULL ((2)));
486
574
# endif
 
575
_GL_CXXALIAS_SYS (mknodat, int,
 
576
                  (int fd, char const *file, mode_t mode, dev_t dev));
 
577
_GL_CXXALIASWARN (mknodat);
487
578
#elif defined GNULIB_POSIXCHECK
488
579
# undef mknodat
489
580
# if HAVE_RAW_DECL_MKNODAT
508
599
#  else /* !_LARGE_FILES */
509
600
#   define stat(name, st) rpl_stat (name, st)
510
601
#  endif /* !_LARGE_FILES */
511
 
extern int stat (const char *name, struct stat *buf) _GL_ARG_NONNULL ((1, 2));
 
602
_GL_EXTERN_C int stat (const char *name, struct stat *buf)
 
603
                      _GL_ARG_NONNULL ((1, 2));
512
604
# endif
513
605
#elif defined GNULIB_POSIXCHECK
514
606
# undef stat
521
613
 
522
614
#if @GNULIB_UTIMENSAT@
523
615
# if @REPLACE_UTIMENSAT@
524
 
#  undef utimensat
525
 
#  define utimensat rpl_utimensat
526
 
# endif
527
 
# if !@HAVE_UTIMENSAT@ || @REPLACE_UTIMENSAT@
528
 
   extern int utimensat (int fd, char const *name,
529
 
                         struct timespec const times[2], int flag)
530
 
        _GL_ARG_NONNULL ((2));
531
 
# endif
 
616
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 
617
#   undef utimensat
 
618
#   define utimensat rpl_utimensat
 
619
#  endif
 
620
_GL_FUNCDECL_RPL (utimensat, int, (int fd, char const *name,
 
621
                                   struct timespec const times[2], int flag)
 
622
                                  _GL_ARG_NONNULL ((2)));
 
623
_GL_CXXALIAS_RPL (utimensat, int, (int fd, char const *name,
 
624
                                   struct timespec const times[2], int flag));
 
625
# else
 
626
#  if !@HAVE_UTIMENSAT@
 
627
_GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
 
628
                                   struct timespec const times[2], int flag)
 
629
                                  _GL_ARG_NONNULL ((2)));
 
630
#  endif
 
631
_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
 
632
                                   struct timespec const times[2], int flag));
 
633
# endif
 
634
_GL_CXXALIASWARN (utimensat);
532
635
#elif defined GNULIB_POSIXCHECK
533
636
# undef utimensat
534
637
# if HAVE_RAW_DECL_UTIMENSAT
538
641
#endif
539
642
 
540
643
 
541
 
#ifdef __cplusplus
542
 
}
543
 
#endif
544
 
 
545
 
 
546
644
#endif /* _GL_SYS_STAT_H */
547
645
#endif /* _GL_SYS_STAT_H */
548
646
#endif