libfontconfig.go 807 B

12345678910111213141516171819202122232425
  1. // Copyright 2024 The libfontconfig-go Authors. All rights reserved.
  2. // Use of the source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:generate go run generator.go
  5. // Package libfontconfig is a ccgo/v4 version of libfontconfig.a, a library
  6. // providing configuration, enumeration and substitution of fonts to other
  7. // programs.
  8. package libfontconfig // import "modernc.org/libfontconfig"
  9. import (
  10. "sync/atomic"
  11. "unsafe"
  12. "modernc.org/libc"
  13. )
  14. func ___sync_bool_compare_and_swap(tls *libc.TLS, p, old, new uintptr) int32 {
  15. return libc.Bool32(atomic.CompareAndSwapUintptr((*uintptr)(unsafe.Pointer(p)), old, new))
  16. }
  17. func ___sync_fetch_and_add_impl(tls *libc.TLS, p uintptr, val int32) int32 {
  18. return atomic.AddInt32((*int32)(unsafe.Pointer(p)), val) - val
  19. }