Browse Source

Misc rewordings, improve comments.

Matt Coburn 5 years ago
parent
commit
f775f32070
2 changed files with 14 additions and 10 deletions
  1. 3 8
      Source/Native/custom/enet_iosFixes.h
  2. 11 2
      Source/Native/custom/enet_logging.h

+ 3 - 8
Source/Native/custom/enet_iosFixes.h

@@ -1,8 +1,3 @@
-#ifndef ENET_IOSFIXES_H
-#define ENET_IOSFIXES_H
-
-#if (__APPLE__)
-
-#endif
-
-#endif
+// File left here for archival purposes.
+// It serves no purpose, since the fix for the pre-iOS 10 clock_gettime()
+// call has already been merged upstream.

+ 11 - 2
Source/Native/custom/enet_logging.h

@@ -40,30 +40,39 @@ static inline void enet_log_to_file(enum enet_log_type type, const char *func, i
 	// iOS Debugging - Sandboxed logging can't write file. This might extend even into Android!
 	// Can't write to files without the file permission... so don't do that if we're on Apple.
 	// https://github.com/SoftwareGuy/ENet-CSharp/issues/15
+
+	// Write the initial debug text to stdout.
 	printf("%s [%s] [%s:%d] ", time_buf, enet_log_type_names[type], func, line);
 	
+	// Write our arguments and related stuff to stdout, then newline it.
 	va_start(args, fmt);	
 	vprintf(fmt, args);	
 	va_end(args);
 	printf("\n");
+
 	// -- End logging for Android and Apple iOS -- //
 #else
-	// Open the log file
+	// Open the log file, and if we can't, then short-circuit.
 	if (!enet_log_fp) enet_log_fp = fopen(ENET_LOG_FILE, "a");
 	if (!enet_log_fp) return;
 
+	// Write the initial debug text to buffer.
 	fprintf(enet_log_fp, "%s [%s] [%s:%d] ", time_buf, enet_log_type_names[type], func, line);
+	
+	// Write our arguments and related stuff to buffer.
 	va_start(args, fmt);
 	vfprintf(enet_log_fp, fmt, args);
 	va_end(args);
 
+	// Write new line marker, then flush and wrap up.
 	fprintf(enet_log_fp, "\n");
 	fflush(enet_log_fp);
+
 	// -- End logging for other platforms -- //
 #endif
 }
 #else
-// Not Debug
+// We are not building a debug library, stub the functions.
 #define ENET_LOG_TRACE(...) ((void)0)
 #define ENET_LOG_ERROR(...) ((void)0)
 #endif