mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Improve seed() function
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* have_environ - Determine if we have the environ user environment value
|
||||
* have_environ - Determine if we have the environ user environment synbol
|
||||
*
|
||||
* Copyright (C) 2021 Landon Curt Noll
|
||||
*
|
||||
@@ -37,8 +37,8 @@
|
||||
* This prog outputs:
|
||||
*
|
||||
* HAVE_ENVIRON
|
||||
* defined ==> environ is an extern symbol
|
||||
* undefined ==> environ is NOT an extern symbol
|
||||
* defined ==> environ is an non-NULL extern symbol
|
||||
* undefined ==> environ is NOT an extern symbol or is NULL
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -47,9 +47,6 @@
|
||||
#include "banned.h" /* include after system header <> includes */
|
||||
|
||||
|
||||
extern char **environ; /* user environment */
|
||||
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
@@ -57,13 +54,17 @@ main(void)
|
||||
|
||||
printf("#undef HAVE_ENVIRON /* no */\n");
|
||||
|
||||
#else /* HAVE_NO_CONST */
|
||||
#else /* HAVE_NO_ENVIRON */
|
||||
|
||||
const char * const str = "const";
|
||||
extern char **environ;
|
||||
|
||||
printf("#define HAVE_ENVIRON /* yes */\n");
|
||||
if (environ == NULL) {
|
||||
printf("#define HAVE_ENVIRON /* no */\n");
|
||||
} else {
|
||||
printf("#define HAVE_ENVIRON /* yes */\n");
|
||||
}
|
||||
|
||||
#endif /* HAVE_NO_CONST */
|
||||
#endif /* HAVE_NO_ENVIRON */
|
||||
|
||||
/* exit(0); */
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user