From: Paul Eggert Date: Sat, 19 Mar 2022 19:35:04 +0000 (-0700) Subject: Omit unnecessary code when !HAVE_NATIVE_COMP X-Git-Tag: emacs-29.0.90~1931^2~1038^2~6 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a5cbd983767c5b3e18e7b039795d036262b41958;p=emacs.git Omit unnecessary code when !HAVE_NATIVE_COMP * src/decompress.c (MD5_BLOCKSIZE, acc_buf, acc_size) (accumulate_and_process_md5, final_process_md5, md5_gz_stream): * src/dynlib.c (dynlib_open_for_eln, dynlib_close) [!WINDOWSNT]: * src/fileio.c (internal_delete_file_1, internal_delete_file): Define only if HAVE_NATIVE_COMP && WINDOWSNT, as they’re not used otherwise. --- diff --git a/src/decompress.c b/src/decompress.c index ddd8abbf27c..dbdc9104a37 100644 --- a/src/decompress.c +++ b/src/decompress.c @@ -67,8 +67,9 @@ init_zlib_functions (void) #endif /* WINDOWSNT */ +#ifdef HAVE_NATIVE_COMP -#define MD5_BLOCKSIZE 32768 /* From md5.c */ +# define MD5_BLOCKSIZE 32768 /* From md5.c */ static char acc_buff[2 * MD5_BLOCKSIZE]; static size_t acc_size; @@ -106,7 +107,7 @@ md5_gz_stream (FILE *source, void *resblock) unsigned char in[MD5_BLOCKSIZE]; unsigned char out[MD5_BLOCKSIZE]; -#ifdef WINDOWSNT +# ifdef WINDOWSNT if (!zlib_initialized) zlib_initialized = init_zlib_functions (); if (!zlib_initialized) @@ -114,7 +115,7 @@ md5_gz_stream (FILE *source, void *resblock) message1 ("zlib library not found"); return -1; } -#endif +# endif eassert (!acc_size); @@ -164,7 +165,8 @@ md5_gz_stream (FILE *source, void *resblock) return 0; } -#undef MD5_BLOCKSIZE +# undef MD5_BLOCKSIZE +#endif diff --git a/src/dynlib.c b/src/dynlib.c index 8cb9a233745..e2c71f14489 100644 --- a/src/dynlib.c +++ b/src/dynlib.c @@ -279,11 +279,13 @@ dynlib_open (const char *path) return dlopen (path, RTLD_LAZY | RTLD_GLOBAL); } +# ifdef HAVE_NATIVE_COMP dynlib_handle_ptr dynlib_open_for_eln (const char *path) { return dlopen (path, RTLD_LAZY); } +# endif void * dynlib_sym (dynlib_handle_ptr h, const char *sym) @@ -313,11 +315,13 @@ dynlib_error (void) return dlerror (); } +# ifdef HAVE_NATIVE_COMP int dynlib_close (dynlib_handle_ptr h) { return dlclose (h) == 0; } +# endif #else diff --git a/src/fileio.c b/src/fileio.c index a0282204de8..5d66a93ac6a 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2505,6 +2505,8 @@ With a prefix argument, TRASH is nil. */) return Qnil; } +#if defined HAVE_NATIVE_COMP && defined WINDOWSNT + static Lisp_Object internal_delete_file_1 (Lisp_Object ignore) { @@ -2523,6 +2525,8 @@ internal_delete_file (Lisp_Object filename) Qt, internal_delete_file_1); return NILP (tem); } + +#endif /* Return -1 if FILE is a case-insensitive file name, 0 if not, and a positive errno value if the result cannot be determined. */