Skip to content

Commit

Permalink
Move away from using __attribute__ directly (Issue #5349)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Jul 9, 2018
1 parent 77094a2 commit be3b49a
Show file tree
Hide file tree
Showing 13 changed files with 299 additions and 330 deletions.
31 changes: 10 additions & 21 deletions cups/debug-private.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* Private debugging macros for CUPS.
*
* Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2005 by Easy Software Products.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2005 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/

#ifndef _CUPS_DEBUG_PRIVATE_H_
Expand Down Expand Up @@ -61,15 +62,6 @@ extern "C" {
*/

# ifdef DEBUG
# ifdef WIN32
# ifdef LIBCUPS2_EXPORTS
# define DLLExport __declspec(dllexport)
# else
# define DLLExport
# endif /* LIBCUPS2_EXPORTS */
# else
# define DLLExport
# endif /* WIN32 */
# define DEBUG_puts(x) _cups_debug_puts(x)
# define DEBUG_printf(x) _cups_debug_printf x
# define DEBUG_set(logfile,level,filter) _cups_debug_set(logfile,level,filter,1)
Expand All @@ -85,16 +77,13 @@ extern "C" {
* Prototypes...
*/

extern int _cups_debug_fd;
extern int _cups_debug_level;
extern void DLLExport _cups_debug_printf(const char *format, ...)
__attribute__ ((__format__ (__printf__, 1, 2)));
extern void DLLExport _cups_debug_puts(const char *s);
extern void DLLExport _cups_debug_set(const char *logfile,
const char *level, const char *filter,
int force);
extern int _cups_debug_fd _CUPS_PRIVATE;
extern int _cups_debug_level _CUPS_PRIVATE;
extern void _cups_debug_printf(const char *format, ...) _CUPS_FORMAT(1,2) _CUPS_PUBLIC;
extern void _cups_debug_puts(const char *s) _CUPS_PUBLIC;
extern void _cups_debug_set(const char *logfile, const char *level, const char *filter, int force) _CUPS_PUBLIC;
# ifdef WIN32
extern int _cups_gettimeofday(struct timeval *tv, void *tz);
extern int _cups_gettimeofday(struct timeval *tv, void *tz) _CUPS_PRIVATE;
# define gettimeofday(a,b) _cups_gettimeofday(a, b)
# endif /* WIN32 */

Expand Down
6 changes: 3 additions & 3 deletions cups/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ debug_thread_id(void)
* '_cups_debug_printf()' - Write a formatted line to the log.
*/

void DLLExport
void
_cups_debug_printf(const char *format, /* I - Printf-style format string */
...) /* I - Additional arguments as needed */
{
Expand Down Expand Up @@ -162,7 +162,7 @@ _cups_debug_printf(const char *format, /* I - Printf-style format string */
* '_cups_debug_puts()' - Write a single line to the log.
*/

void DLLExport
void
_cups_debug_puts(const char *s) /* I - String to output */
{
struct timeval curtime; /* Current time */
Expand Down Expand Up @@ -242,7 +242,7 @@ _cups_debug_puts(const char *s) /* I - String to output */
* '_cups_debug_set()' - Enable or disable debug logging.
*/

void DLLExport
void
_cups_debug_set(const char *logfile, /* I - Log file or NULL */
const char *level, /* I - Log level or NULL */
const char *filter, /* I - Filter string or NULL */
Expand Down
40 changes: 14 additions & 26 deletions cups/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
* our own file functions allows us to provide transparent support of
* different line endings, gzip'd print files, PPD files, etc.
*
* Copyright 2007-2017 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
* Copyright © 2007-2018 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
* Licensed under Apache License v2.0. See the file "LICENSE" for more
* information.
*/

#ifndef _CUPS_FILE_H_
Expand Down Expand Up @@ -61,43 +62,30 @@ typedef struct _cups_file_s cups_file_t;/**** CUPS file type ****/
extern int cupsFileClose(cups_file_t *fp) _CUPS_API_1_2;
extern int cupsFileCompression(cups_file_t *fp) _CUPS_API_1_2;
extern int cupsFileEOF(cups_file_t *fp) _CUPS_API_1_2;
extern const char *cupsFileFind(const char *filename, const char *path,
int executable, char *buffer,
int bufsize) _CUPS_API_1_2;
extern const char *cupsFileFind(const char *filename, const char *path, int executable, char *buffer, int bufsize) _CUPS_API_1_2;
extern int cupsFileFlush(cups_file_t *fp) _CUPS_API_1_2;
extern int cupsFileGetChar(cups_file_t *fp) _CUPS_API_1_2;
extern char *cupsFileGetConf(cups_file_t *fp, char *buf,
size_t buflen, char **value,
int *linenum) _CUPS_API_1_2;
extern size_t cupsFileGetLine(cups_file_t *fp, char *buf,
size_t buflen) _CUPS_API_1_2;
extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen)
_CUPS_API_1_2;
extern char *cupsFileGetConf(cups_file_t *fp, char *buf, size_t buflen, char **value, int *linenum) _CUPS_API_1_2;
extern size_t cupsFileGetLine(cups_file_t *fp, char *buf, size_t buflen) _CUPS_API_1_2;
extern char *cupsFileGets(cups_file_t *fp, char *buf, size_t buflen) _CUPS_API_1_2;
extern int cupsFileLock(cups_file_t *fp, int block) _CUPS_API_1_2;
extern int cupsFileNumber(cups_file_t *fp) _CUPS_API_1_2;
extern cups_file_t *cupsFileOpen(const char *filename, const char *mode)
_CUPS_API_1_2;
extern cups_file_t *cupsFileOpen(const char *filename, const char *mode) _CUPS_API_1_2;
extern cups_file_t *cupsFileOpenFd(int fd, const char *mode) _CUPS_API_1_2;
extern int cupsFilePeekChar(cups_file_t *fp) _CUPS_API_1_2;
extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...)
__attribute__((__format__ (__printf__, 2, 3)))
_CUPS_API_1_2;
extern int cupsFilePrintf(cups_file_t *fp, const char *format, ...) _CUPS_FORMAT(2, 3) _CUPS_API_1_2;
extern int cupsFilePutChar(cups_file_t *fp, int c) _CUPS_API_1_2;
extern ssize_t cupsFilePutConf(cups_file_t *fp, const char *directive,
const char *value) _CUPS_API_1_4;
extern int cupsFilePuts(cups_file_t *fp, const char *s)
_CUPS_API_1_2;
extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes)
_CUPS_API_1_2;
extern ssize_t cupsFilePutConf(cups_file_t *fp, const char *directive, const char *value) _CUPS_API_1_4;
extern int cupsFilePuts(cups_file_t *fp, const char *s) _CUPS_API_1_2;
extern ssize_t cupsFileRead(cups_file_t *fp, char *buf, size_t bytes) _CUPS_API_1_2;
extern off_t cupsFileRewind(cups_file_t *fp) _CUPS_API_1_2;
extern off_t cupsFileSeek(cups_file_t *fp, off_t pos) _CUPS_API_1_2;
extern cups_file_t *cupsFileStderr(void) _CUPS_API_1_2;
extern cups_file_t *cupsFileStdin(void) _CUPS_API_1_2;
extern cups_file_t *cupsFileStdout(void) _CUPS_API_1_2;
extern off_t cupsFileTell(cups_file_t *fp) _CUPS_API_1_2;
extern int cupsFileUnlock(cups_file_t *fp) _CUPS_API_1_2;
extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf,
size_t bytes) _CUPS_API_1_2;
extern ssize_t cupsFileWrite(cups_file_t *fp, const char *buf, size_t bytes) _CUPS_API_1_2;


# ifdef __cplusplus
Expand Down
Loading

0 comments on commit be3b49a

Please sign in to comment.