Update to nonstd.h

Author Mitja Felicijan <mitja.felicijan@gmail.com> 2026-01-23 00:10:10 +0100
Committer Mitja Felicijan <mitja.felicijan@gmail.com> 2026-01-23 00:10:10 +0100
Commit 67e3f3d5d10a3fbde1e050b623fc727b27842c8a (patch)
-rw-r--r-- nonstd.h 38
1 files changed, 37 insertions, 1 deletions
diff --git a/nonstd.h b/nonstd.h
  
1
// nonstd.h
  
2
// A collection of useful functions and macros.
  
3
// This library is licensed under the BSD 2-Clause License.
  
4
// 
  
5
// This file provides both the interface and the implementation.
  
6
// To instantiate the implementation,
  
7
//     #define NONSTD_IMPLEMENTATION
  
8
//  before including this file.
  
9
  
1
#ifdef NONSTD_IMPLEMENTATION
10
#ifdef NONSTD_IMPLEMENTATION
2
#ifndef _POSIX_C_SOURCE
11
#ifndef _POSIX_C_SOURCE
3
#define _POSIX_C_SOURCE 200809L
12
#define _POSIX_C_SOURCE 200809L
...
795
	ppm_draw_line(canvas, x2, y2, x0, y0, color);
804
	ppm_draw_line(canvas, x2, y2, x0, y0, color);
796
}
805
}
797
  
806
  
798
#endif // NONSTD_IMPLEMENTATION
807
#endif // NONSTD_IMPLEMENTATION
  
808
  
  
809
/*
  
810
BSD 2-Clause License
  
811
  
  
812
Copyright (c) 2026, Mitja Felicijan <mitja.felicijan@gmail.com>
  
813
  
  
814
Redistribution and use in source and binary forms, with or without
  
815
modification, are permitted provided that the following conditions are met:
  
816
  
  
817
1. Redistributions of source code must retain the above copyright notice, this
  
818
   list of conditions and the following disclaimer.
  
819
  
  
820
2. Redistributions in binary form must reproduce the above copyright notice,
  
821
   this list of conditions and the following disclaimer in the documentation
  
822
   and/or other materials provided with the distribution.
  
823
  
  
824
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  
825
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  
826
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  
827
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  
828
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  
829
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  
830
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  
831
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  
832
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  
833
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
834
*/