diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2018-10-16 16:09:17 -0400 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2018-10-16 16:09:17 -0400 |
commit | 86206ccf13c909e67fdbe0a4ddba0152a571cd9d (patch) | |
tree | 4b3eb663d139309bdbbe408d4671695ca6ce5d4d /cups | |
parent | d3a97696d785af4fd1c00254b3b26150d915f921 (diff) |
Add missing DNSSD.LIB functions.
Diffstat (limited to 'cups')
-rw-r--r-- | cups/http-addrlist.c | 16 | ||||
-rw-r--r-- | cups/http-support.c | 3 | ||||
-rw-r--r-- | cups/ipp-file.c | 2 | ||||
-rw-r--r-- | cups/libcups2.def | 12 | ||||
-rw-r--r-- | cups/raster-stream.c | 2 | ||||
-rw-r--r-- | cups/tempfile.c | 2 | ||||
-rw-r--r-- | cups/tls-sspi.c | 24 | ||||
-rw-r--r-- | cups/usersys.c | 4 |
8 files changed, 28 insertions, 37 deletions
diff --git a/cups/http-addrlist.c b/cups/http-addrlist.c index 23031f50a..ea2021ce6 100644 --- a/cups/http-addrlist.c +++ b/cups/http-addrlist.c @@ -57,13 +57,13 @@ httpAddrConnect2( { int val; /* Socket option value */ #ifndef _WIN32 - int flags; /* Socket flags */ -#endif /* !_WIN32 */ - int remaining; /* Remaining timeout */ int i, j, /* Looping vars */ - nfds, /* Number of file descriptors */ - fds[100], /* Socket file descriptors */ + flags, /* Socket flags */ result; /* Result from select() or poll() */ +#endif /* !_WIN32 */ + int remaining; /* Remaining timeout */ + int nfds, /* Number of file descriptors */ + fds[100]; /* Socket file descriptors */ http_addrlist_t *addrs[100]; /* Addresses */ #ifndef HAVE_POLL int max_fd = -1; /* Highest file descriptor */ @@ -79,8 +79,10 @@ httpAddrConnect2( # endif /* HAVE_POLL */ #endif /* O_NONBLOCK */ #ifdef DEBUG +# ifndef _WIN32 socklen_t len; /* Length of value */ http_addr_t peer; /* Peer address */ +# endif /* !_WIN32 */ char temp[256]; /* Temporary address string */ #endif /* DEBUG */ @@ -649,7 +651,11 @@ httpAddrGetList(const char *hostname, /* I - Hostname, IP address, or NULL for p if (error == EAI_FAIL) cg->need_res_init = 1; +# ifdef _WIN32 /* Really, Microsoft?!? */ + _cupsSetError(IPP_STATUS_ERROR_INTERNAL, gai_strerrorA(error), 0); +# else _cupsSetError(IPP_STATUS_ERROR_INTERNAL, gai_strerror(error), 0); +# endif /* _WIN32 */ } #else diff --git a/cups/http-support.c b/cups/http-support.c index 364939bcc..3ce38885e 100644 --- a/cups/http-support.c +++ b/cups/http-support.c @@ -1763,9 +1763,6 @@ _httpResolveURI( _http_uribuf_t uribuf; /* URI buffer */ int offline = 0; /* offline-report state set? */ # ifdef HAVE_DNSSD -# ifdef _WIN32 -# pragma comment(lib, "dnssd.lib") -# endif /* _WIN32 */ DNSServiceRef ref, /* DNS-SD master service reference */ domainref = NULL,/* DNS-SD service reference for domain */ ippref = NULL, /* DNS-SD service reference for network IPP */ diff --git a/cups/ipp-file.c b/cups/ipp-file.c index 0234de555..dabc5356e 100644 --- a/cups/ipp-file.c +++ b/cups/ipp-file.c @@ -23,7 +23,7 @@ static ipp_t *parse_collection(_ipp_file_t *f, _ipp_vars_t *v, void *user_data); static int parse_value(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, ipp_t *ipp, ipp_attribute_t **attr, int element); -static void report_error(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *message, ...) __attribute((__format__ (__printf__, 4, 5))); +static void report_error(_ipp_file_t *f, _ipp_vars_t *v, void *user_data, const char *message, ...) _CUPS_FORMAT(4, 5); /* diff --git a/cups/libcups2.def b/cups/libcups2.def index 8a32f27e8..409e8b71d 100644 --- a/cups/libcups2.def +++ b/cups/libcups2.def @@ -41,18 +41,6 @@ _cupsRWUnlock _cupsRasterAddError _cupsRasterClearError _cupsRasterExecPS -_cupsSNMPClose -_cupsSNMPCopyOID -_cupsSNMPDefaultCommunity -_cupsSNMPIsOID -_cupsSNMPIsOIDPrefixed -_cupsSNMPOIDToString -_cupsSNMPOpen -_cupsSNMPRead -_cupsSNMPSetDebug -_cupsSNMPStringToOID -_cupsSNMPWalk -_cupsSNMPWrite _cupsSetDefaults _cupsSetError _cupsSetHTTPError diff --git a/cups/raster-stream.c b/cups/raster-stream.c index 7ab278b43..54adfb808 100644 --- a/cups/raster-stream.c +++ b/cups/raster-stream.c @@ -1188,7 +1188,7 @@ _cupsRasterWritePixels( else bytes = cups_raster_io(r, p, len); - if (bytes < len) + if (bytes < (ssize_t)len) return (0); else return (len); diff --git a/cups/tempfile.c b/cups/tempfile.c index e305c6cd9..9b72f1e83 100644 --- a/cups/tempfile.c +++ b/cups/tempfile.c @@ -54,7 +54,7 @@ cupsTempFd(char *filename, /* I - Pointer to buffer */ #ifdef _WIN32 if ((tmpdir = getenv("TEMP")) == NULL) { - GetTempPath(sizeof(tmppath), tmppath); + GetTempPathA(sizeof(tmppath), tmppath); tmpdir = tmppath; } diff --git a/cups/tls-sspi.c b/cups/tls-sspi.c index 91c8961f2..6e3c03b9e 100644 --- a/cups/tls-sspi.c +++ b/cups/tls-sspi.c @@ -186,7 +186,7 @@ httpCredentialsAreValidForName( if (cert) { - if (CertNameToStr(X509_ASN_ENCODING, &(cert->pCertInfo->Subject), CERT_SIMPLE_NAME_STR, cert_name, sizeof(cert_name))) + if (CertNameToStrA(X509_ASN_ENCODING, &(cert->pCertInfo->Subject), CERT_SIMPLE_NAME_STR, cert_name, sizeof(cert_name))) { /* * Extract common name at end... @@ -360,7 +360,7 @@ httpCredentialsString( expiration = mktime(&tm); - if (CertNameToStr(X509_ASN_ENCODING, &(cert->pCertInfo->Subject), CERT_SIMPLE_NAME_STR, cert_name, sizeof(cert_name))) + if (CertNameToStrA(X509_ASN_ENCODING, &(cert->pCertInfo->Subject), CERT_SIMPLE_NAME_STR, cert_name, sizeof(cert_name))) { /* * Extract common name at end... @@ -467,7 +467,7 @@ httpLoadCredentials( dwSize = 0; - if (!CertStrToName(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, NULL, &dwSize, NULL)) + if (!CertStrToNameA(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, NULL, &dwSize, NULL)) { DEBUG_printf(("1httpLoadCredentials: CertStrToName failed: %s", http_sspi_strerror(error, sizeof(error), GetLastError()))); goto cleanup; @@ -481,7 +481,7 @@ httpLoadCredentials( goto cleanup; } - if (!CertStrToName(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, p, &dwSize, NULL)) + if (!CertStrToNameA(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, p, &dwSize, NULL)) { DEBUG_printf(("1httpLoadCredentials: CertStrToName failed: %s", http_sspi_strerror(error, sizeof(error), GetLastError()))); goto cleanup; @@ -590,7 +590,7 @@ httpSaveCredentials( dwSize = 0; - if (!CertStrToName(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, NULL, &dwSize, NULL)) + if (!CertStrToNameA(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, NULL, &dwSize, NULL)) { DEBUG_printf(("1httpSaveCredentials: CertStrToName failed: %s", http_sspi_strerror(error, sizeof(error), GetLastError()))); goto cleanup; @@ -604,7 +604,7 @@ httpSaveCredentials( goto cleanup; } - if (!CertStrToName(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, p, &dwSize, NULL)) + if (!CertStrToNameA(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, p, &dwSize, NULL)) { DEBUG_printf(("1httpSaveCredentials: CertStrToName failed: %s", http_sspi_strerror(error, sizeof(error), GetLastError()))); goto cleanup; @@ -1350,7 +1350,7 @@ http_sspi_client(http_t *http, /* I - Client connection */ */ dwSize = sizeof(username); - GetUserName(username, &dwSize); + GetUserNameA(username, &dwSize); snprintf(common_name, sizeof(common_name), "CN=%s", username); if (!http_sspi_find_credentials(http, L"ClientContainer", common_name)) @@ -1713,7 +1713,7 @@ http_sspi_find_credentials( dwSize = 0; - if (!CertStrToName(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, NULL, &dwSize, NULL)) + if (!CertStrToNameA(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, NULL, &dwSize, NULL)) { DEBUG_printf(("5http_sspi_find_credentials: CertStrToName failed: %s", http_sspi_strerror(sspi->error, sizeof(sspi->error), GetLastError()))); ok = FALSE; @@ -1729,7 +1729,7 @@ http_sspi_find_credentials( goto cleanup; } - if (!CertStrToName(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, p, &dwSize, NULL)) + if (!CertStrToNameA(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, p, &dwSize, NULL)) { DEBUG_printf(("5http_sspi_find_credentials: CertStrToName failed: %s", http_sspi_strerror(sspi->error, sizeof(sspi->error), GetLastError()))); ok = FALSE; @@ -1924,7 +1924,7 @@ http_sspi_make_credentials( dwSize = 0; - if (!CertStrToName(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, NULL, &dwSize, NULL)) + if (!CertStrToNameA(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, NULL, &dwSize, NULL)) { DEBUG_printf(("5http_sspi_make_credentials: CertStrToName failed: %s", http_sspi_strerror(sspi->error, sizeof(sspi->error), GetLastError()))); ok = FALSE; @@ -1940,7 +1940,7 @@ http_sspi_make_credentials( goto cleanup; } - if (!CertStrToName(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, p, &dwSize, NULL)) + if (!CertStrToNameA(X509_ASN_ENCODING, common_name, CERT_OID_NAME_STR, NULL, p, &dwSize, NULL)) { DEBUG_printf(("5http_sspi_make_credentials: CertStrToName failed: %s", http_sspi_strerror(sspi->error, sizeof(sspi->error), GetLastError()))); ok = FALSE; @@ -2296,7 +2296,7 @@ http_sspi_strerror(char *buffer, /* I - Error message buffer */ size_t bufsize, /* I - Size of buffer */ DWORD code) /* I - Error code */ { - if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, code, 0, buffer, bufsize, NULL)) + if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, code, 0, buffer, bufsize, NULL)) { /* * Strip trailing CR + LF... diff --git a/cups/usersys.c b/cups/usersys.c index 3cf265646..f9764fb42 100644 --- a/cups/usersys.c +++ b/cups/usersys.c @@ -500,7 +500,7 @@ cupsSetUserAgent(const char *user_agent)/* I - User-Agent string or @code NULL@ #ifdef _WIN32 version.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&version); + GetVersionExA(&version); GetNativeSystemInfo(&sysinfo); snprintf(cg->user_agent, sizeof(cg->user_agent), @@ -1103,7 +1103,7 @@ cups_finalize_client_conf( DWORD size; /* Size of string */ size = sizeof(cc->user); - if (!GetUserName(cc->user, &size)) + if (!GetUserNameA(cc->user, &size)) #else /* * Try the USER environment variable as the default username... |