Fix build warnings/errs w/ -DNO_GETENV/-DNO_PUTENV
- strtest.c: Fix unused variable warnings if both -DNO_GETENV and -DNO_PUTENV are specified or if only -DNO_GETENV is specified. - jinclude.h: Fix build error if only -DNO_GETENV is specified. Fixes #697
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1994, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2022, D. R. Commander.
|
||||
* Copyright (C) 2022-2023, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README.ijg
|
||||
* file.
|
||||
*
|
||||
@@ -123,6 +123,8 @@ static INLINE int GETENV_S(char *buffer, size_t buffer_size, const char *name)
|
||||
|
||||
#else
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
/* This provides a similar interface to the Microsoft _putenv_s() function, but
|
||||
* other than parameter validation, it has no advantages over setenv().
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C)2022 D. R. Commander. All Rights Reserved.
|
||||
* Copyright (C)2022-2023 D. R. Commander. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -55,8 +55,12 @@ void invalid_parameter_handler(const wchar_t *expression,
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#if !defined(NO_GETENV) || !defined(NO_PUTENV)
|
||||
int err;
|
||||
#endif
|
||||
#ifndef NO_GETENV
|
||||
char env[3];
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
_set_invalid_parameter_handler(invalid_parameter_handler);
|
||||
|
||||
Reference in New Issue
Block a user